本文介绍了WL 5.0.6.1 Android - 在安装的应用程序之上更新应用程序(.apk文件)导致Web资源加载失败 - WebView启动中断 - 首次启动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们使用JS源代码中的更改重新编译android APK并使用Testflight或Eclipse Android Tools在已安装的应用APK的APK之上安装此APK时,我们会看到以下问题第一次启动应用程序(第二次启动):

When we are re-compiling the android APK with changes in the JS sources and use Testflight or Eclipse Android Tools to install this APK on top of an already installed APK of the app we are seeing the following problems at the first start of the App (the second time it works):

以下打印件来自AVD with Android 4.3 API 18.应用程序启动也会中断在真实设备上,但我们还没有调试打印。

The following prints are from the AVD with Android 4.3 API 18. The app startup also breaks on the real device, but we do not have debug prints yet.

当我们有:

<encryptWebResources enabled="false"/>

然后我们看到:

09-04 13:28:21.908: D/WLDroidGap(2322): New installation/upgrade detected, copying resources and saving new checksum
09-04 13:28:22.417: D/CordovaWebView(2322): DroidGap.loadUrl(file:///data/data/com.App/files/www/default/App.html, 60000)
09-04 13:28:22.417: D/DroidGap(2322): onMessage(splashscreen,show)
09-04 13:28:22.417: D/CordovaWebView(2322): >>> loadUrl(file:///data/data/com.App/files/www/default/App.html)
09-04 13:28:22.417: D/PluginManager(2322): init()
09-04 13:28:22.427: D/CordovaWebView(2322): >>> loadUrlNow()
09-04 13:28:22.427: D/DroidGap(2322): Resuming the App
09-04 13:28:22.497: D/libEGL(2322): loaded /system/lib/egl/libEGL_emulation.so
09-04 13:28:22.507: D/(2322): HostConnection::get() New Host Connection established 0x2a213708, tid 2322
09-04 13:28:22.517: D/libEGL(2322): loaded /system/lib/egl/libGLESv1_CM_emulation.so
09-04 13:28:22.517: D/libEGL(2322): loaded /system/lib/egl/libGLESv2_emulation.so
09-04 13:28:22.577: W/EGL_emulation(2322): eglSurfaceAttrib not implemented
09-04 13:28:22.587: D/OpenGLRenderer(2322): Enabling debug mode 0
09-04 13:28:22.597: D/SoftKeyboardDetect(2322): Ignore this event
09-04 13:28:22.627: W/EGL_emulation(2322): eglSurfaceAttrib not implemented
09-04 13:28:22.838: D/WLDroidGap(2322): Started copying files to local storage...
09-04 13:28:22.928: D/SoftKeyboardDetect(2322): Ignore this event
09-04 13:28:30.978: D/dalvikvm(2322): GC_FOR_ALLOC freed 1561K, 19% free 7469K/9188K, paused 25ms, total 25ms
09-04 13:28:37.098: D/WLDroidGap(2322): Finished copying files to local storage...
09-04 13:28:37.098: D/WLDroidGap(2322): no need to check web resource integrity
09-04 13:28:37.148: D/DroidGap(2322): onMessage(onPageStarted,file:///data/data/com.App/files/www/default/App.html)
09-04 13:28:42.448: E/CordovaWebView(2322): CordovaWebView: TIMEOUT ERROR!
09-04 13:28:42.448: D/Cordova(2322): CordovaWebViewClient.onReceivedError: Error code=-6 Description=The connection to the server was unsuccessful. URL=file:///data/data/com.App/files/www/default/App.html
09-04 13:28:42.448: D/DroidGap(2322): onMessage(onReceivedError,{"errorCode":-6,"url":"file:\/\/\/data\/data\/com.App\/files\/www\/default\/App.html","description":"The connection to the server was unsuccessful."})

当我们拥有:

<encryptWebResources enabled="true"/>

然后我们看到:

    App09-04 14:56:46.408: D/dalvikvm(3375): GC_FOR_ALLOC freed 42K, 8% free 2640K/2840K, paused 25ms, total 30ms
09-04 14:56:46.417: I/dalvikvm-heap(3375): Grow heap (frag case) to 3.803MB for 1127536-byte allocation
09-04 14:56:46.447: D/dalvikvm(3375): GC_FOR_ALLOC freed <1K, 6% free 3741K/3944K, paused 34ms, total 34ms
09-04 14:56:46.547: I/CordovaLog(3375): Changing log level to DEBUG(3)
09-04 14:56:46.557: I/CordovaLog(3375): Found preference for exit-on-suspend=false
09-04 14:56:46.557: D/CordovaLog(3375): Found preference for exit-on-suspend=false
09-04 14:56:46.557: I/CordovaLog(3375): Found preference for show-splash-screen-spinner=true
09-04 14:56:46.557: D/CordovaLog(3375): Found preference for show-splash-screen-spinner=true
09-04 14:56:46.577: D/JsMessageQueue(3375): Set native->JS mode to 2
09-04 14:56:46.637: D/DroidGap(3375): DroidGap.init()
09-04 14:56:46.748: D/dalvikvm(3375): GC_FOR_ALLOC freed 121K, 7% free 3802K/4080K, paused 39ms, total 39ms
09-04 14:56:46.778: I/dalvikvm-heap(3375): Grow heap (frag case) to 7.379MB for 3686416-byte allocation
09-04 14:56:46.808: D/dalvikvm(3375): GC_FOR_ALLOC freed <1K, 4% free 7402K/7684K, paused 29ms, total 29ms
09-04 14:56:46.828: D/WLDroidGap(3375): New installation/upgrade detected, copying resources and saving new checksum
09-04 14:56:47.278: D/CordovaWebView(3375): DroidGap.loadUrl(file:///data/data/com.App/files/www/default/App.html, 60000)
09-04 14:56:47.278: D/DroidGap(3375): onMessage(splashscreen,show)
09-04 14:56:47.278: D/CordovaWebView(3375): >>> loadUrl(file:///data/data/com.App/files/www/default/App.html)
09-04 14:56:47.278: D/PluginManager(3375): init()
09-04 14:56:47.288: D/CordovaWebView(3375): >>> loadUrlNow()
09-04 14:56:47.298: D/DroidGap(3375): Resuming the App
09-04 14:56:47.367: D/libEGL(3375): loaded /system/lib/egl/libEGL_emulation.so
09-04 14:56:47.367: D/(3375): HostConnection::get() New Host Connection established 0x2a21e670, tid 3375
09-04 14:56:47.387: D/libEGL(3375): loaded /system/lib/egl/libGLESv1_CM_emulation.so
09-04 14:56:47.387: D/libEGL(3375): loaded /system/lib/egl/libGLESv2_emulation.so
09-04 14:56:47.428: W/EGL_emulation(3375): eglSurfaceAttrib not implemented
09-04 14:56:47.447: D/OpenGLRenderer(3375): Enabling debug mode 0
09-04 14:56:47.457: D/SoftKeyboardDetect(3375): Ignore this event
09-04 14:56:47.487: W/EGL_emulation(3375): eglSurfaceAttrib not implemented
09-04 14:56:47.668: D/WLDroidGap(3375): Started copying files to local storage...
09-04 14:56:47.677: D/WLDroidGap(3375): Found resources zip stream. Starting decryption and unzipping process.
09-04 14:56:47.687: I/dalvikvm(3375): Could not find method com.worklight.utils.PaidSecurityUtils.kpg, referenced from method com.worklight.utils.SecurityUtils.kpg
09-04 14:56:47.687: W/dalvikvm(3375): VFY: unable to resolve static method 8750: Lcom/worklight/utils/PaidSecurityUtils;.kpg (Landroid/content/Context;[Ljava/lang/String;)[B
09-04 14:56:47.687: D/dalvikvm(3375): VFY: replacing opcode 0x71 at 0x0000
09-04 14:56:47.798: D/SoftKeyboardDetect(3375): Ignore this event
09-04 14:56:47.898: I/dalvikvm(3375): Total arena pages for JIT: 11
09-04 14:56:47.898: I/dalvikvm(3375): Total arena pages for JIT: 12
09-04 14:56:47.898: I/dalvikvm(3375): Total arena pages for JIT: 13
09-04 14:56:47.898: I/dalvikvm(3375): Total arena pages for JIT: 14
09-04 14:56:47.898: I/dalvikvm(3375): Total arena pages for JIT: 15
09-04 14:56:47.908: I/dalvikvm(3375): Total arena pages for JIT: 16
09-04 14:56:47.908: I/dalvikvm(3375): Total arena pages for JIT: 17
09-04 14:56:47.938: I/dalvikvm(3375): Total arena pages for JIT: 18
09-04 14:56:54.987: D/dalvikvm(3375): GC_FOR_ALLOC freed 1500K, 19% free 7536K/9192K, paused 25ms, total 25ms
09-04 14:56:56.067: D/WLDroidGap(3375): Resources.zip unzipped
09-04 14:56:56.067: D/WLDroidGap(3375): Finished copying files to local storage...
09-04 14:56:56.077: D/WLDroidGap(3375): no need to check web resource integrity
09-04 14:56:56.127: D/DroidGap(3375): onMessage(onPageStarted,file:///data/data/com.App/files/www/default/App.html)
09-04 14:57:03.768: E/cutils-trace(3375): Error opening trace file: No such file or directory (2)
09-04 14:57:06.108: D/CordovaLog(3375): [object Object]
09-04 14:57:06.108: I/Web Console(3375): [object Object] at file:///data/data/com.App/files/www/default/js/appNav.js:174
09-04 14:57:07.318: E/CordovaWebView(3375): CordovaWebView: TIMEOUT ERROR!
09-04 14:57:07.318: D/Cordova(3375): CordovaWebViewClient.onReceivedError: Error code=-6 Description=The connection to the server was unsuccessful. URL=file:///data/data/com.App/files/www/default/App.html
09-04 14:57:07.327: D/DroidGap(3375): onMessage(onReceivedError,{"errorCode":-6,"url":"file:\/\/\/data\/data\/com.App\/files\/www\/default\/App.html","description":"The connection to the server was unsuccessful."})
09-04 14:57:07.567: D/SoftKeyboardDetect(3375): Ignore this event
09-04 14:57:07.808: W/EGL_emulation(3375): eglSurfaceAttrib not implemented
09-04 14:57:07.968: D/Cordova(3375): onPageFinished(file:///data/data/com.App/files/www/default/App.html)
09-04 14:57:07.979: D/DroidGap(3375): onMessage(onNativeReady,null)
09-04 14:57:07.979: D/DroidGap(3375): onMessage(onPageFinished,file:///data/data/com.App/files/www/default/App.html)
09-04 14:57:08.088: E/SQLiteLog(3375): (14) cannot open file at line 30191 of [00bb9c9ce4]
09-04 14:57:08.098: E/SQLiteLog(3375): (14) os_unix.c:30191: (2) open(/CachedGeoposition.db) - 
09-04 14:57:08.098: D/WebKit(3375): ERROR: 
09-04 14:57:08.098: D/WebKit(3375): SQLite database failed to load from /CachedGeoposition.db
09-04 14:57:08.098: D/WebKit(3375): Cause - unable to open database file
09-04 14:57:08.098: D/WebKit(3375): external/webkit/Source/WebCore/platform/sql/SQLiteDatabase.cpp(71) : bool WebCore::SQLiteDatabase::open(const WTF::String&, bool)
09-04 14:57:08.228: D/CordovaNetworkManager(3375): Connection Type: 3g
09-04 14:57:08.238: D/DroidGap(3375): onMessage(networkconnection,3g)
09-04 14:57:08.248: D/CordovaNetworkManager(3375): Connection Type: 3g
09-04 14:57:08.288: D/DroidGap(3375): onMessage(spinner,stop)
09-04 14:57:08.288: D/SoftKeyboardDetect(3375): Ignore this event
09-04 14:57:08.327: D/TilesManager(3375): Starting TG #0, 0x2a2d6440
09-04 14:57:08.338: D/TilesManager(3375): new EGLContext from framework: 2a21e9c0 
09-04 14:57:08.338: D/GLWebViewState(3375): Reinit shader
09-04 14:57:08.387: D/App(3375): ondeviceready event dispatched
09-04 14:57:08.427: D/App(3375): wlclient init started
09-04 14:57:08.447: D/App(3375): Read cookies: null
09-04 14:57:08.457: D/App(3375): CookieMgr read cookies: {}
09-04 14:57:08.657: D/App(3375): Request [http://XXX:8080/apps/services/api/App/android/init]
09-04 14:57:08.868: D/GLWebViewState(3375): Reinit transferQueue
09-04 14:57:09.118: D/(3375): HostConnection::get() New Host Connection established 0x2a8da1b0, tid 3405
09-04 14:57:09.278: W/EGL_emulation(3375): eglSurfaceAttrib not implemented
09-04 14:57:09.577: D/App(3375): Request [http://XXX:8080/apps/services/api/App/android/init]
09-04 14:57:09.778: D/App(3375): response [http://XXX:8080/apps/services/api/App/android/init] success: /*-secure-
09-04 14:57:09.778: D/App(3375): {"userPrefs":{},"WL-Authentication-Success":{"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"wl_antiXSRFRealm":{"userId":"cov37tnm5kcuievnjlq18ruh6k","attributes":{},"isUserAuthenticated":1,"displayName":"cov37tnm5kcuievnjlq18ruh6k"},"wl_deviceNoProvisioningRealm":{"userId":"71ecfc9e-69f1-41c7-9007-7da6e31207f1","attributes":{"mobileClientData":"com.worklight.core.auth.impl.MobileClientData@1df9ea5f"},"isUserAuthenticated":1,"displayName":"71ecfc9e-69f1-41c7-9007-7da6e31207f1"},"wl_anonymousUserRealm":{"userId":"74a2c152-5a50-4d73-9644-177b7db04c9b","attributes":{},"isUserAuthenticated":1,"displayName":"74a2c152-5a50-4d73-9644-177b7db04c9b"}},"gadgetProps":{"ENVIRONMENT":"android"},"userInfo":{"SubscribeServlet":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_authenticityRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"SampleAppRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"wl_antiXSRFRealm":{"userId":"cov37tnm5kcuievnjlq18ruh6k","attributes":{},"isUserAuthenticated":1,"displayName":"cov37tnm5kcuievnjlq18ruh6k"},"WorklightConsole":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_deviceAutoProvisioningRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_deviceNoProvisioningRealm":{"userId":"71ecfc9e-69f1-41c7-9007-7da6e31207f1","attributes":{"mobileClientData":"com.worklight.core.auth.impl.MobileClientData@1df9ea5f"},"isUserAuthenticated":1,"displayName":"71ecfc9e-69f1-41c7-9007-7da6e31207f1"},"myserver":{"userId":"74a2c152-5a50-4d73-9644-177b7db04c9b","attributes":{},"isUserAuthenticated":1,"displayName":"74a2c152-5a50-4d73-9644-177b7db04c9b"},"wl_anonymousUserRealm":{"userId":"74a2c152-5a50-4d73-9644-177b7db04c9b","attributes":{},"isUserAuthenticated":1,"displayName":"74a2c152-5a50-4d73-9644-177b7db04c9b"}}}*/
09-04 14:57:09.798: D/App(3375): wlclient connect success
09-04 14:57:09.868: E/App(3375): [http://XXX:8080/apps/services/api/App/android/init] exception. Cannot read property 'skinLoaderContent' of undefined
09-04 14:57:09.948: D/CordovaLog(3375): Uncaught TypeError: Cannot read property 'skinLoaderContent' of undefined
09-04 14:57:09.948: E/Web Console(3375): Uncaught TypeError: Cannot read property 'skinLoaderContent' of undefined at file:///data/data/com.App/files/www/default/wlclient/js/worklight.js:1487

在webview中复制文件和打开文件似乎有某种竞争条件......

It seems like some sort of race-condition with copying files and opening files in the webview...

我们尝试了一些与上述结果相同的实验:

We tried some experiments that all had the same results as presented above:


  • 我们将connectOnStartup更改为false并将WL.Client.connect手动连接到WL服务器wlCommonInit()

  • we changed the "connectOnStartup" to false and WL.Client.connect connected manually to WL server in wlCommonInit()

增加了initOption超时

increased the initOption timeout

以下似乎可以减少问题...但它没有解决问题。多次尝试时只有更少的中断:

The following seemed to reduce the problem... but it did not remove the problem. Only fewer breaks when trying it several times:


  • 每次在重新编译之前在应用程序描述符中增加Android应用程序环境版本。 (这将在发布到Google Play商店之前完成!)

以下似乎消除了这个问题:

The following seemed to eliminate the problem:


  • 每次重新编译和部署之前交换encryptWebResources参数true / false,apk安装

  • swapping the encryptWebResources parameter true/false every time before a re-compile and deploy, apk install

在启动时根本没有连接到WL服务器...没有connectOnStartup而wlCommonInit()中没有WL.Client.connect。

not connecting to the WL Server at startup at all ... no connectOnStartup and no WL.Client.connect in wlCommonInit().

有没有人遇到过这个问题,并且会就如何解决这个问题提出一些建议?

Has anyone ever encountered this problem and would have some suggestions on how to work around it?

似乎有一种本土方式捕获上面第一种情况中被触发的 onReceiveError Cordova事件 - 但是工作灯没有这样做?:

There seems to be a native way to catch the onReceiveError Cordova event that is being fired in the first case above - but worklight is not doing that?:Catching phonegap GapViewClient.onReceivedError in javascript

这是启动成功时的输出(例如交换encryptWebResources参数后):

This is the output when the startup is successful (e.g. after swapping encryptWebResources parameter):

App09-04 15:22:01.378: D/dalvikvm(3575): GC_FOR_ALLOC freed 53K, 8% free 2640K/2852K, paused 25ms, total 30ms
09-04 15:22:01.388: I/dalvikvm-heap(3575): Grow heap (frag case) to 3.803MB for 1127536-byte allocation
09-04 15:22:01.418: D/dalvikvm(3575): GC_FOR_ALLOC freed <1K, 6% free 3741K/3956K, paused 35ms, total 35ms
09-04 15:22:01.518: I/CordovaLog(3575): Changing log level to DEBUG(3)
09-04 15:22:01.528: I/CordovaLog(3575): Found preference for exit-on-suspend=false
09-04 15:22:01.538: D/CordovaLog(3575): Found preference for exit-on-suspend=false
09-04 15:22:01.538: I/CordovaLog(3575): Found preference for show-splash-screen-spinner=true
09-04 15:22:01.538: D/CordovaLog(3575): Found preference for show-splash-screen-spinner=true
09-04 15:22:01.578: D/JsMessageQueue(3575): Set native->JS mode to 2
09-04 15:22:01.578: D/DroidGap(3575): DroidGap.init()
09-04 15:22:01.717: D/dalvikvm(3575): GC_FOR_ALLOC freed 120K, 7% free 3802K/4080K, paused 36ms, total 37ms
09-04 15:22:01.747: I/dalvikvm-heap(3575): Grow heap (frag case) to 7.378MB for 3686416-byte allocation
09-04 15:22:01.787: D/dalvikvm(3575): GC_FOR_ALLOC freed <1K, 4% free 7402K/7684K, paused 32ms, total 32ms
09-04 15:22:01.797: D/WLDroidGap(3575): New installation/upgrade detected, copying resources and saving new checksum
09-04 15:22:02.248: D/CordovaWebView(3575): DroidGap.loadUrl(file:///data/data/com.App/files/www/skinLoader.html, 60000)
09-04 15:22:02.248: D/DroidGap(3575): onMessage(splashscreen,show)
09-04 15:22:02.248: D/CordovaWebView(3575): >>> loadUrl(file:///data/data/com.App/files/www/skinLoader.html)
09-04 15:22:02.248: D/PluginManager(3575): init()
09-04 15:22:02.258: D/CordovaWebView(3575): >>> loadUrlNow()
09-04 15:22:02.258: D/DroidGap(3575): Resuming the App
09-04 15:22:02.338: D/libEGL(3575): loaded /system/lib/egl/libEGL_emulation.so
09-04 15:22:02.338: D/(3575): HostConnection::get() New Host Connection established 0x2a23a318, tid 3575
09-04 15:22:02.348: D/libEGL(3575): loaded /system/lib/egl/libGLESv1_CM_emulation.so
09-04 15:22:02.358: D/libEGL(3575): loaded /system/lib/egl/libGLESv2_emulation.so
09-04 15:22:02.418: W/EGL_emulation(3575): eglSurfaceAttrib not implemented
09-04 15:22:02.428: D/OpenGLRenderer(3575): Enabling debug mode 0
09-04 15:22:02.437: D/SoftKeyboardDetect(3575): Ignore this event
09-04 15:22:02.468: W/EGL_emulation(3575): eglSurfaceAttrib not implemented
09-04 15:22:02.627: D/WLDroidGap(3575): Started copying files to local storage...
09-04 15:22:02.747: D/SoftKeyboardDetect(3575): Ignore this event
09-04 15:22:10.618: D/dalvikvm(3575): GC_FOR_ALLOC freed 1563K, 19% free 7469K/9192K, paused 24ms, total 25ms
09-04 15:22:16.718: D/WLDroidGap(3575): Finished copying files to local storage...
09-04 15:22:16.728: D/WLDroidGap(3575): no need to check web resource integrity
09-04 15:22:16.778: D/DroidGap(3575): onMessage(onPageStarted,file:///data/data/com.App/files/www/skinLoader.html)
09-04 15:22:17.458: D/chromium(3575): Unknown chromium error: -6
09-04 15:22:17.488: D/Cordova(3575): onPageFinished(file:///data/data/com.App/files/www/skinLoader.html)
09-04 15:22:17.488: D/DroidGap(3575): onMessage(onNativeReady,null)
09-04 15:22:17.488: D/DroidGap(3575): onMessage(onPageFinished,file:///data/data/com.App/files/www/skinLoader.html)
09-04 15:22:17.498: E/cutils-trace(3575): Error opening trace file: No such file or directory (2)
09-04 15:22:17.558: E/SQLiteLog(3575): (14) cannot open file at line 30191 of [00bb9c9ce4]
09-04 15:22:17.558: E/SQLiteLog(3575): (14) os_unix.c:30191: (2) open(/CachedGeoposition.db) - 
09-04 15:22:17.558: D/WebKit(3575): ERROR: 
09-04 15:22:17.558: D/WebKit(3575): SQLite database failed to load from /CachedGeoposition.db
09-04 15:22:17.558: D/WebKit(3575): Cause - unable to open database file
09-04 15:22:17.558: D/WebKit(3575): external/webkit/Source/WebCore/platform/sql/SQLiteDatabase.cpp(71) : bool WebCore::SQLiteDatabase::open(const WTF::String&, bool)
09-04 15:22:17.678: D/CordovaNetworkManager(3575): Connection Type: 3g
09-04 15:22:17.678: D/DroidGap(3575): onMessage(networkconnection,3g)
09-04 15:22:17.688: D/CordovaNetworkManager(3575): Connection Type: 3g
09-04 15:22:17.738: D/DroidGap(3575): onMessage(spinner,stop)
09-04 15:22:17.758: D/TilesManager(3575): Starting TG #0, 0x2a23d728
09-04 15:22:17.758: D/TilesManager(3575): new EGLContext from framework: 2a23a668 
09-04 15:22:17.758: D/GLWebViewState(3575): Reinit shader
09-04 15:22:17.837: D/GLWebViewState(3575): Reinit transferQueue
09-04 15:22:17.873: D/CordovaWebView(3575): >>> loadUrl(file:///data/data/com.App/files/www/default/App.html)
09-04 15:22:17.877: D/CordovaWebView(3575): >>> loadUrlNow()
09-04 15:22:17.897: D/DroidGap(3575): onMessage(onPageStarted,file:///data/data/com.App/files/www/default/App.html)
09-04 15:22:19.508: D/DroidGap(3575): onMessage(spinner,stop)
09-04 15:22:26.567: D/CordovaLog(3575): [object Object]
09-04 15:22:26.567: I/Web Console(3575): [object Object] at file:///data/data/com.App/files/www/default/js/appNav.js:174
09-04 15:22:27.898: D/Cordova(3575): onPageFinished(file:///data/data/com.App/files/www/default/App.html)
09-04 15:22:27.898: D/DroidGap(3575): onMessage(onNativeReady,null)
09-04 15:22:27.908: D/DroidGap(3575): onMessage(onPageFinished,file:///data/data/com.App/files/www/default/App.html)
09-04 15:22:27.948: D/(3575): HostConnection::get() New Host Connection established 0x2a6ca158, tid 3605
09-04 15:22:28.118: D/CordovaNetworkManager(3575): Connection Type: 3g
09-04 15:22:28.128: D/CordovaNetworkManager(3575): Connection Type: 3g
09-04 15:22:28.148: D/DroidGap(3575): onMessage(networkconnection,3g)
09-04 15:22:28.168: D/DroidGap(3575): onMessage(spinner,stop)
09-04 15:22:28.188: D/App(3575): ondeviceready event dispatched
09-04 15:22:28.258: D/App(3575): wlclient init started
09-04 15:22:28.288: D/App(3575): Read cookies: null
09-04 15:22:28.298: D/App(3575): CookieMgr read cookies: {}
09-04 15:22:28.577: D/dalvikvm(3575): GC_FOR_ALLOC freed 774K, 18% free 7613K/9232K, paused 61ms, total 67ms
09-04 15:22:28.607: D/App(3575): Request [http://XXX:8080/apps/services/api/App/android/init]
09-04 15:22:28.768: W/EGL_emulation(3575): eglSurfaceAttrib not implemented
09-04 15:22:29.477: D/App(3575): Request [http://XXX:8080/apps/services/api/App/android/init]
09-04 15:22:29.587: D/App(3575): response [http://XXX:8080/apps/services/api/App/android/init] success: /*-secure-
09-04 15:22:29.587: D/App(3575): {"userPrefs":{},"WL-Authentication-Success":{"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"wl_antiXSRFRealm":{"userId":"dnp53p3bq3h02g6d6bpkgs7al0","attributes":{},"isUserAuthenticated":1,"displayName":"dnp53p3bq3h02g6d6bpkgs7al0"},"wl_deviceNoProvisioningRealm":{"userId":"71ecfc9e-69f1-41c7-9007-7da6e31207f1","attributes":{"mobileClientData":"com.worklight.core.auth.impl.MobileClientData@7483ddc7"},"isUserAuthenticated":1,"displayName":"71ecfc9e-69f1-41c7-9007-7da6e31207f1"},"wl_anonymousUserRealm":{"userId":"74a2c152-5a50-4d73-9644-177b7db04c9b","attributes":{},"isUserAuthenticated":1,"displayName":"74a2c152-5a50-4d73-9644-177b7db04c9b"}},"gadgetProps":{"directUpdate":{"updateUnpackedSize":4464136,"availableSkins":["default"],"checksum":4181283381,"updateSize":1934792},"ENVIRONMENT":"android"},"userInfo":{"SubscribeServlet":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_authenticityRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"SampleAppRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"wl_antiXSRFRealm":{"userId":"dnp53p3bq3h02g6d6bpkgs7al0","attributes":{},"isUserAuthenticated":1,"displayName":"dnp53p3bq3h02g6d6bpkgs7al0"},"WorklightConsole":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_deviceAutoProvisioningRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_deviceNoProvisioningRealm":{"userId":"71ecfc9e-69f1-41c7-9007-7da6e31207f1","attributes":{"mobileClientData":"com.worklight.core.auth.impl.MobileClientData@7483ddc7"},"isUserAuthenticated":1,"displayName":"71ecfc9e-69f1-41c7-9007-7da6e31207f1"},"myserver":{"userId":"74a2c152-5a50-4d73-9644-177b7db04c9b","attributes":{},"isUserAuthenticated":1,"displayName":"74a2c152-5a50-4d73-9644-177b7db04c9b"},"wl_anonymousUserRealm":{"userId":"74a2c152-5a50-4d73-9644-177b7db04c9b","attributes":{},"isUserAuthenticated":1,"displayName":"74a2c152-5a50-4d73-9644-177b7db04c9b"}}}*/
09-04 15:22:29.597: D/App(3575): wlclient connect success
09-04 15:22:29.637: D/App(3575): before: app init onSuccess
09-04 15:22:29.637: D/App(3575): in startBusyIndicator
09-04 15:22:29.648: D/App(3575): busyIndicator is null or not visible, so create and show
09-04 15:22:29.668: D/App(3575): Exiting startBusyIndicator: [object Object]
09-04 15:22:29.668: D/App(3575): WL.Client.connect by-passed
09-04 15:22:29.868: W/EGL_emulation(3575): eglSurfaceAttrib not implemented
09-04 15:22:29.898: D/App(3575): after: app init onSuccess
09-04 15:22:29.898: D/App(3575): wlclient init success
09-04 15:22:30.297: D/App(3575): Request [http://XXX:8080/apps/services/api/App/android/query]
09-04 15:22:30.467: D/CordovaLog(3575): [object Object]
09-04 15:22:30.467: I/Web Console(3575): [object Object] at file:///data/data/com.App/files/www/default/js/appNav.js:174
09-04 15:22:31.347: D/Cordova(3575): onPageFinished(file:///data/data/com.App/files/www/default/App.html#/data/data/com.App/files/www/default/pages/home/Home.html)
09-04 15:22:31.347: D/DroidGap(3575): onMessage(onNativeReady,null)
09-04 15:22:31.347: D/DroidGap(3575): onMessage(onPageFinished,file:///data/data/com.App/files/www/default/App.html#/data/data/com.App/files/www/default/pages/home/Home.html)
09-04 15:22:31.547: D/App(3575): response [http://XXX:8080/apps/services/api/App/android/query] success: /*-secure-
09-04 15:22:31.547: D/App(3575): {"responseID":"574","result":{"travelAdvisory"}},"isSuccessful":true}*/
09-04 15:22:31.618: E/App(3575): [http://XXX:8080/apps/services/api/App/android/query] exception. Cannot read property 'question' of undefined
09-04 15:22:31.767: D/CordovaLog(3575): Uncaught TypeError: Cannot read property 'question' of undefined
09-04 15:22:31.767: E/Web Console(3575): Uncaught TypeError: Cannot read property 'question' of undefined at file:///data/data/com.App/files/www/default/wlclient/js/worklight.js:1487
09-04 15:22:35.187: D/App(3575): Hiding splash screen
09-04 15:22:35.197: D/App(3575): in stopBusyIndicator: [object Object]
09-04 15:22:35.207: D/DroidGap(3575): onMessage(splashscreen,hide)
09-04 15:22:36.218: D/App(3575): Calling initializeAirportLookupData
09-04 15:22:59.908: D/App(3575): Hiding splash screen
09-04 15:22:59.908: D/App(3575): in stopBusyIndicator: [object Object]
09-04 15:22:59.917: D/DroidGap(3575): onMessage(splashscreen,hide)

设备测试更新

在测试设备LG Optimus G上安装Android 4.1.2错误的t上面的第二个案例:

On the test device LG Optimus G with Android 4.1.2 the Error of the second case above with:

09-04 14:57:09.798: D/App(3375): wlclient connect success
09-04 14:57:09.868: E/App(3375): [http://XXX:8080/apps/services/api/App/android/init] exception. Cannot read property 'skinLoaderContent' of undefined
09-04 14:57:09.948: D/CordovaLog(3375): Uncaught TypeError: Cannot read property 'skinLoaderContent' of undefined
09-04 14:57:09.948: E/Web Console(3375): Uncaught TypeError: Cannot read property 'skinLoaderContent' of undefined at file:///data/data/com.App/files/www/default/wlclient/js/worklight.js:1487

第二次我们运行为Android应用 USB连接设备。中间的其他时间成功运行而没有错误。

happens every second time we "Run As" "Android Application" on the USB connected device. The other times in-between work successfully without error.

当我们在启动时没有连接时,它总能正常工作。

When we do not connect at startup it always works fine.

推荐答案

最近向Worklight 5.0.6.x及更高版本发布了一项更新,其中显着改进了用户在Worklight应用程序时必须等待的时间第一次启动。

An update was recently issued to Worklight 5.0.6.x and above with significant improvements regarding the amount of time the user must wait when Worklight applications are started for the first time.

参见相关的IBM技术说明:

See relevant IBM tech note: http://www-01.ibm.com/support/docview.wss?uid=swg27040464

我建议客户获得更新版本的5.0.6.1(= iFix),或者等待5.0.6.2(= Fixpack)即将发布。

I suggest for the customer get a newer version of 5.0.6.1 (= iFix), or wait for 5.0.6.2 (= Fixpack) to be released, soon.

这篇关于WL 5.0.6.1 Android - 在安装的应用程序之上更新应用程序(.apk文件)导致Web资源加载失败 - WebView启动中断 - 首次启动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 01:11