Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Android Cordova 3.6.4 breaks the compatibility with some versions of Android(4.0 and 4.0.3). The app won't load.
The console print the "TypeError “Cannot set property connection of #<Navigator>”" . Then, it cause the device ready event can't be fired.
There is another issue CB-7868 also mention this error. Also, I tried to merge the fixing of CB-7868,https://github.com/apache/cordova-js/pull/88, into my project. But, I still get the same error only on Android 4.0(API 14) and Android 4.0.3(API 15) emulator.
Then, I merge the following fixing mentioned by Andrew Grieve on CB-7868. It works now.
***************
function clobber(obj, key, value) {
exports.replaceHookForTesting(obj, key);
- obj[key] = value;
+ var needsProperty = false;
+ try { + obj[key] = value; + }catch (e)
{ + needsProperty = true; + }// Getters can only be overridden by getters.
- if (obj[key] !== value) {
+ if (needsProperty || obj[key] !== value) {
utils.defineGetter(obj, key, function() { return value; });
*************
I also get the IOS cordova 3.7.0. I found the fixing with https://github.com/apache/cordova-js/pull/88 has been applied. But, the function, clobber , still don't has above fixing.
So, my question is that, what's the right fixing for the error.