[ 
https://issues.apache.org/jira/browse/CB-8042?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

JoeSong updated CB-8042:
------------------------
    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. 


  was:
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 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. 


> Still got the error “Cannot set property connection of #<Navigator>” with 
> fixing of CB-7868 on Android cordova 3.6.4
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: CB-8042
>                 URL: https://issues.apache.org/jira/browse/CB-8042
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android, CordovaJS
>            Reporter: JoeSong
>            Priority: Blocker
>
> 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. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to