You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2014/08/07 22:25:14 UTC

[jira] [Commented] (CB-7261) Unable to switch to ONLINE_EVENT Native to JS mode after switching to POLLING

    [ https://issues.apache.org/jira/browse/CB-7261?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14089766#comment-14089766 ] 

ASF subversion and git services commented on CB-7261:
-----------------------------------------------------

Commit 41125ea1e2ce9bff3191f57d88c10c277cbb3e94 in cordova-android's branch refs/heads/master from [~agrieve]
[ https://git-wip-us.apache.org/repos/asf?p=cordova-android.git;h=41125ea ]

CB-7261 Fix setNativeToJsBridgeMode sometimes crashing when switching to ONLINE_EVENT


> Unable to switch to ONLINE_EVENT Native to JS mode after switching to POLLING
> -----------------------------------------------------------------------------
>
>                 Key: CB-7261
>                 URL: https://issues.apache.org/jira/browse/CB-7261
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: Android
>    Affects Versions: 3.5.0
>         Environment: Nexus 4 running Android (KitKat) 4.4.4
>            Reporter: Nathan Smith
>            Assignee: Andrew Grieve
>            Priority: Minor
>
> Switching between ONLINE_EVENT and POLLING Native to JS modes on Android results in the following exception:
> {code}
> 08-05 13:18:29.729: DEBUG/JsMessageQueue(25805): Set native->JS mode to 2
> 08-05 13:18:29.739: WARN/WebView(25805): java.lang.Throwable: A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 1) {41ec6650} called on Looper (JavaBridge, tid 3688) {41ed39e8}, FYI main Looper is Looper (main, tid 1) {41ec6650})
>         at android.webkit.WebView.checkThread(WebView.java:2072)
>         at android.webkit.WebView.setNetworkAvailable(WebView.java:705)
>         at org.apache.cordova.NativeToJsMessageQueue$OnlineEventsBridgeMode.reset(NativeToJsMessageQueue.java:320)
>         at org.apache.cordova.NativeToJsMessageQueue.setBridgeMode(NativeToJsMessageQueue.java:105)
>         at org.apache.cordova.ExposedJsApi.setNativeToJsBridgeMode(ExposedJsApi.java:69)
>         at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
>         at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:24)
>         at android.os.Handler.dispatchMessage(Handler.java:102)
>         at android.os.Looper.loop(Looper.java:136)
>         at android.os.HandlerThread.run(HandlerThread.java:61)
> 08-05 13:18:29.749: WARN/System.err(25805): java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 1) {41ec6650} called on Looper (JavaBridge, tid 3688) {41ed39e8}, FYI main Looper is Looper (main, tid 1) {41ec6650})
> 08-05 13:18:29.749: WARN/System.err(25805): at android.webkit.WebView.checkThread(WebView.java:2082)
> 08-05 13:18:29.749: WARN/System.err(25805): at android.webkit.WebView.setNetworkAvailable(WebView.java:705)
> 08-05 13:18:29.749: WARN/System.err(25805): at org.apache.cordova.NativeToJsMessageQueue$OnlineEventsBridgeMode.reset(NativeToJsMessageQueue.java:320)
> 08-05 13:18:29.749: WARN/System.err(25805): at org.apache.cordova.NativeToJsMessageQueue.setBridgeMode(NativeToJsMessageQueue.java:105)
> 08-05 13:18:29.749: WARN/System.err(25805): at org.apache.cordova.ExposedJsApi.setNativeToJsBridgeMode(ExposedJsApi.java:69)
> 08-05 13:18:29.749: WARN/System.err(25805): at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
> 08-05 13:18:29.749: WARN/System.err(25805): at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:24)
> 08-05 13:18:29.749: WARN/System.err(25805): at android.os.Handler.dispatchMessage(Handler.java:102)
> 08-05 13:18:29.749: WARN/System.err(25805): at android.os.Looper.loop(Looper.java:136)
> 08-05 13:18:29.749: WARN/System.err(25805): at android.os.HandlerThread.run(HandlerThread.java:61)
> 08-05 13:18:29.749: WARN/System.err(25805): Caused by: java.lang.Throwable: A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 1) {41ec6650} called on Looper (JavaBridge, tid 3688) {41ed39e8}, FYI main Looper is Looper (main, tid 1) {41ec6650})
> 08-05 13:18:29.749: WARN/System.err(25805): at android.webkit.WebView.checkThread(WebView.java:2072)
> 08-05 13:18:29.749: WARN/System.err(25805): ... 9 more
> 08-05 13:18:29.749: DEBUG/CordovaLog(25805): file:///android_asset/www/app/app.js: Line 30018 : processMessage failed: Error: Error: Error calling method on NPObject.
> 08-05 13:18:29.749: INFO/chromium(25805): [INFO:CONSOLE(30018)] "processMessage failed: Error: Error: Error calling method on NPObject.", source: file:///android_asset/www/app/app.js (30018)
> 08-05 13:18:29.759: DEBUG/CordovaLog(25805): file:///android_asset/www/app/app.js: Line 30018 : processMessage failed: Stack: Error: Error calling method on NPObject.
>         at Function.androidExec.setNativeToJsBridgeMode (file:///android_asset/www/cordova.js:993:29)
>         at _.extend._androidResult (file:///android_asset/www/app/app.js:30433:33)
>         at file:///android_asset/www/app/app.js:587:28
>         at Object.cordova.callbackFromNative (file:///android_asset/www/cordova.js:292:54)
>         at processMessage (file:///android_asset/www/cordova.js:1039:21)
>         at Function.androidExec.processMessages (file:///android_asset/www/cordova.js:1076:13)
>         at pollOnce (file:///android_asset/www/cordova.js:944:17)
>         at pollingTimerFunc (file:///android_asset/www/cordova.js:949:9)
> 08-05 13:18:29.759: INFO/chromium(25805): [INFO:CONSOLE(30018)] "processMessage failed: Stack: Error: Error calling method on NPObject.
>         at Function.androidExec.setNativeToJsBridgeMode (file:///android_asset/www/cordova.js:993:29)
>         at _.extend._androidResult (file:///android_asset/www/app/app.js:30433:33)
>         at file:///android_asset/www/app/app.js:587:28
>         at Object.cordova.callbackFromNative (file:///android_asset/www/cordova.js:292:54)
>         at processMessage (file:///android_asset/www/cordova.js:1039:21)
>         at Function.androidExec.processMessages (file:///android_asset/www/cordova.js:1076:13)
>         at pollOnce (file:///android_asset/www/cordova.js:944:17)
>         at pollingTimerFunc (file:///android_asset/www/cordova.js:949:9)", source: file:///android_asset/www/app/app.js (30018)
> 08-05 13:18:29.759: DEBUG/CordovaLog(25805): file:///android_asset/www/app/app.js: Line 30018 : processMessage failed: Message: S01 VerifyCertificateService774585263 sOK
> 08-05 13:18:29.759: INFO/chromium(25805): [INFO:CONSOLE(30018)] "processMessage failed: Message: S01 VerifyCertificateService774585263 sOK", source: file:///android_asset/www/app/app.js (30018)
> {code}
> {{webView.setNetworkAvailable(true);}} in OnlineEventsBridgeMode.reset() needs to run in the UI Thread.



--
This message was sent by Atlassian JIRA
(v6.2#6252)