问题
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):
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.
When we have:
<encryptWebResources enabled="false"/>
then we see:
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."})
When we have:
<encryptWebResources enabled="true"/>
then we see:
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
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:
we changed the "connectOnStartup" to false and WL.Client.connect connected manually to WL server in wlCommonInit()
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:
- increasing the Android Application Environment Version in the application-descriptor every time before re-compile. (which would be done before publishing to Google Play Store!)
The following seemed to eliminate the problem:
swapping the encryptWebResources parameter true/false every time before a re-compile and deploy, apk install
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?
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
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)
UPDATE on Device Tests
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
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.
回答1:
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.
See relevant IBM tech note: http://www-01.ibm.com/support/docview.wss?uid=swg27040464
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.
来源:https://stackoverflow.com/questions/18623390/wl-5-0-6-1-android-updating-app-apk-file-on-top-of-installed-app-causes-web