I've developed a hybrid application using Worklight 6.1 + Dojo 1.8. The application tests out fine using Chrome "Common & Android". When I deploy the device to my Nexus-7 Tablet running 4.3 all of my views appear together, and the dojo widget are simply text content.
I reviewd a previous post titled : "Worklight mobile app doesn't load dojo mobile widgets on android 4.x devices" I'm experiencing the same situation, and I also, have followed the steps mentioned in several posting found across the Web.
•Make sure to have all dojo required files under www folder...
•Uncheck "Provide Library Resources" option from Dojo Library Request console before the
project building...
•Reeplace core-web-layer_ROOT.js and mobile-ui-layer_ROOT.js from www/dojo/nls/ with the ones
in toolkit/dojo/dojo/nls
My device is set to the language English(US) I've seen the suggestion to move "dojo/nls/core-web-layer_en-us.js" to my dojo project, but the DojoLib project created by Worklight does not have a "en" bundle. My impression is that "en-us" local should be a default and no other files would need to be copied. If this file "dojo/nls/core-web-layer_en-us.js" is required to be part of my project I'm not sure where to retrieve it from. I will attach the logcat content here showing the application deployment to the device as well as the application startup. I apprecaite any help you can provide to resolve this issue::
02-11 14:25:41.892: I/CordovaLog(7468): Changing log level to DEBUG(3)
02-11 14:25:41.892: D/CordovaActivity(7468): CordovaActivity.onCreate()
02-11 14:25:41.942: D/dalvikvm(7468): GC_FOR_ALLOC freed 77K, 2% free 7778K/7920K, paused 20ms, total 21ms
02-11 14:25:41.942: I/dalvikvm-heap(7468): Grow heap (frag case) to 8.107MB for 474560-byte allocation
02-11 14:25:41.982: D/dalvikvm(7468): GC_FOR_ALLOC freed 1K, 2% free 8241K/8384K, paused 35ms, total 35ms
02-11 14:25:42.072: D/CordovaWebView(7468): CordovaWebView is running on device made by: asus
02-11 14:25:42.082: D/JsMessageQueue(7468): Set native->JS mode to 2
02-11 14:25:42.082: D/CordovaActivity(7468): CordovaActivity.init()
02-11 14:25:42.092: W/com.worklight.androidgap.analytics.WLAnalytics(7468): TLF_configurator.enable was called, but the required Tealeaf libraries are not present in the classpath.
02-11 14:25:42.112: D/Whitelist(7468): Unlimited access to network resources
02-11 14:25:42.112: I/CordovaLog(7468): Changing log level to DEBUG(3)
02-11 14:25:42.112: D/CordovaActivity(7468): Resuming the App
02-11 14:25:42.112: D/CordovaActivity(7468): CB-3064: The errorUrl is null
02-11 14:25:42.132: D/dalvikvm(7468): GC_FOR_ALLOC freed 593K, 8% free 8142K/8804K, paused 22ms, total 22ms
02-11 14:25:42.132: D/WLDroidGap(7468): no need to check web resource integrity
02-11 14:25:42.152: D/libEGL(7468): loaded /system/lib/egl/libEGL_tegra.so
02-11 14:25:42.172: D/libEGL(7468): loaded /system/lib/egl/libGLESv1_CM_tegra.so
02-11 14:25:42.182: D/libEGL(7468): loaded /system/lib/egl/libGLESv2_tegra.so
02-11 14:25:42.202: D/OpenGLRenderer(7468): Enabling debug mode 0
02-11 14:25:42.202: D/SoftKeyboardDetect(7468): Ignore this event
02-11 14:25:42.222: D/CordovaWebView(7468): >>> loadUrl(file:///data/data/com.SeterusSnapShot/files/www/default/index.html)
02-11 14:25:42.222: D/PluginManager(7468): init()
02-11 14:25:42.222: D/CordovaWebView(7468): >>> loadUrlNow()
02-11 14:25:42.252: D/CordovaActivity(7468): onMessage(onPageStarted,file:///data/data/com.SeterusSnapShot/files/www/default/index.html)
02-11 14:25:42.262: D/SoftKeyboardDetect(7468): Ignore this event
02-11 14:25:43.512: D/chromium(7468): Unknown chromium error: -6
02-11 14:25:43.512: D/chromium(7468): Unknown chromium error: -6
02-11 14:25:43.522: D/chromium(7468): Unknown chromium error: -6
02-11 14:25:43.532: D/CordovaLog(7468): file:///data/data/com.SeterusSnapShot/files/www/default/js/snapShotView.js: Line 18 : XXXXXXXXXXX Entering snapShotList() to setup loan info data.::1234567890
02-11 14:25:43.532: I/Web Console(7468): XXXXXXXXXXX Entering snapShotList() to setup loan info data.::1234567890 at file:///data/data/com.SeterusSnapShot/files/www/default/js/snapShotView.js:18
02-11 14:25:43.532: D/CordovaLog(7468): file:///data/data/com.SeterusSnapShot/files/www/default/js/snapShotView.js: Line 46 : XXXXXXXXXXX Build, or refresh the loan list information
02-11 14:25:43.532: I/Web Console(7468): XXXXXXXXXXX Build, or refresh the loan list information at file:///data/data/com.SeterusSnapShot/files/www/default/js/snapShotView.js:46
02-11 14:25:43.672: D/CordovaActivity(7468): onMessage(spinner,stop)
02-11 14:25:43.692: D/CordovaNetworkManager(7468): Connection Type: wifi
02-11 14:25:43.702: D/CordovaNetworkManager(7468): Connection Type: wifi
02-11 14:25:43.702: D/CordovaActivity(7468): onMessage(networkconnection,wifi)
02-11 14:25:43.842: D/CordovaLog(7468): file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js: Line 21 : Error: scriptError
02-11 14:25:43.842: E/Web Console(7468): Error: scriptError at file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js:21
02-11 14:25:43.852: D/CordovaLog(7468): file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js: Line 21 : Error: scriptError
02-11 14:25:43.852: E/Web Console(7468): Error: scriptError at file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js:21
02-11 14:25:43.922: D/CordovaLog(7468): file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js: Line 21 : Error: scriptError
02-11 14:25:43.922: E/Web Console(7468): Error: scriptError at file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js:21
02-11 14:25:43.952: D/chromium(7468): Unknown chromium error: -6
02-11 14:25:43.952: D/chromium(7468): Unknown chromium error: -6
02-11 14:25:43.972: D/TilesManager(7468): Starting TG #0, 0x62a51060
02-11 14:25:43.972: D/TilesManager(7468): new EGLContext from framework: 59f9dde0
02-11 14:25:43.972: D/GLWebViewState(7468): Reinit shader
02-11 14:25:43.982: D/GLWebViewState(7468): Reinit transferQueue
02-11 14:25:43.982: D/CordovaWebViewClient(7468): onPageFinished(file:///data/data/com.SeterusSnapShot/files/www/default/index.html)
02-11 14:25:43.982: D/CordovaActivity(7468): onMessage(onPageFinished,file:///data/data/com.SeterusSnapShot/files/www/default/index.html)
02-11 14:25:44.022: D/CordovaLog(7468): file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js: Line 21 : Error: scriptError
02-11 14:25:44.022: E/Web Console(7468): Error: scriptError at file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js:21
02-11 14:25:44.022: D/CordovaLog(7468): file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js: Line 21 : Error: scriptError
02-11 14:25:44.022: E/Web Console(7468): Error: scriptError at file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js:21
02-11 14:25:44.082: D/SeterusSnapShot(7468): wlclient init started
02-11 14:25:44.082: D/SeterusSnapShot(7468): Read cookies: null
02-11 14:25:44.082: D/SeterusSnapShot(7468): CookieMgr read cookies: {}
02-11 14:25:44.132: W/SeterusSnapShot(7468): Your application is using the WL.OptionsMenu API. Note that, if your application targets Android 3.0 (API level 11) or higher, WL.OptionsMenu might have no effect, depending on the device.
02-11 14:25:44.152: D/SeterusSnapShot(7468): addDeviceIDHeader deviceIDSuccessCallback
02-11 14:25:44.152: D/SeterusSnapShot(7468): connectOnStartup finalizeInit
02-11 14:25:44.152: D/SeterusSnapShot(7468): before: app init onSuccess
02-11 14:25:44.172: D/WLDroidGap(7468): unregisterReceivers:Receiver not registered: null
02-11 14:25:44.172: D/WLDroidGap(7468): unregisterReceivers:Receiver not registered: null
02-11 14:25:44.172: D/SeterusSnapShot(7468): after: app init onSuccess
02-11 14:25:44.182: D/SeterusSnapShot(7468): added onPause event handler
02-11 14:25:44.182: D/SeterusSnapShot(7468): wlclient init success
02-11 14:29:18.792: D/CordovaWebView(7468): The current URL is: file:///data/data/com.SeterusSnapShot/files/www/default/index.html
02-11 14:29:18.792: D/CordovaWebView(7468): The URL at item 0 is:file:///data/data/com.SeterusSnapShot/files/www/default/index.html
02-11 14:29:18.952: D/CordovaActivity(7468): Paused the application!
02-11 14:29:18.952: D/CordovaWebView(7468): Handle the pause
02-11 14:29:18.952: D/SeterusSnapShot(7468): Flush called
02-11 14:29:19.602: D/CordovaActivity(7468): CordovaActivity.onDestroy()
02-11 14:29:19.632: D/CordovaWebView(7468): >>> loadUrlNow()
02-11 14:29:19.662: D/WLDroidGap(7468): unregisterReceivers:Receiver not registered: null
02-11 14:29:19.682: I/AndroidRuntime(7468): VM exiting with result code 0, cleanup skipped.
02-11 14:46:48.742: I/CordovaLog(7902): Changing log level to DEBUG(3)
02-11 14:46:48.742: D/CordovaActivity(7902): CordovaActivity.onCreate()
02-11 14:46:48.782: D/dalvikvm(7902): GC_FOR_ALLOC freed 59K, 2% free 7778K/7904K, paused 17ms, total 17ms
02-11 14:46:48.782: I/dalvikvm-heap(7902): Grow heap (frag case) to 8.107MB for 474560-byte allocation
02-11 14:46:48.812: D/dalvikvm(7902): GC_FOR_ALLOC freed 1K, 2% free 8241K/8368K, paused 24ms, total 24ms
02-11 14:46:48.892: D/CordovaWebView(7902): CordovaWebView is running on device made by: asus
02-11 14:46:48.902: D/JsMessageQueue(7902): Set native->JS mode to 2
02-11 14:46:48.912: D/CordovaActivity(7902): CordovaActivity.init()
02-11 14:46:48.922: W/com.worklight.androidgap.analytics.WLAnalytics(7902): TLF_configurator.enable was called, but the required Tealeaf libraries are not present in the classpath.
02-11 14:46:48.932: D/WLDroidGap(7902): New installation/upgrade detected, copying resources and saving new checksum
02-11 14:46:48.932: D/Whitelist(7902): Unlimited access to network resources
02-11 14:46:48.942: I/CordovaLog(7902): Changing log level to DEBUG(3)
02-11 14:46:48.942: D/CordovaActivity(7902): Resuming the App
02-11 14:46:48.942: D/CordovaActivity(7902): CB-3064: The errorUrl is null
02-11 14:46:48.982: D/WLDroidGap(7902): Started copying files to local storage...
02-11 14:46:48.982: D/libEGL(7902): loaded /system/lib/egl/libEGL_tegra.so
02-11 14:46:49.002: D/libEGL(7902): loaded /system/lib/egl/libGLESv1_CM_tegra.so
02-11 14:46:49.022: D/libEGL(7902): loaded /system/lib/egl/libGLESv2_tegra.so
02-11 14:46:49.042: D/OpenGLRenderer(7902): Enabling debug mode 0
02-11 14:46:49.052: D/SoftKeyboardDetect(7902): Ignore this event
02-11 14:46:49.152: D/SoftKeyboardDetect(7902): Ignore this event
02-11 14:46:49.172: D/dalvikvm(7902): GC_FOR_ALLOC freed 599K, 8% free 8145K/8808K, paused 16ms, total 16ms
02-11 14:46:49.722: D/dalvikvm(7902): GC_FOR_ALLOC freed 436K, 8% free 8155K/8808K, paused 14ms, total 14ms
02-11 14:46:49.942: D/dalvikvm(7902): GC_FOR_ALLOC freed 439K, 8% free 8163K/8808K, paused 14ms, total 14ms
02-11 14:46:50.282: D/dalvikvm(7902): GC_FOR_ALLOC freed 457K, 8% free 8163K/8808K, paused 18ms, total 18ms
02-11 14:46:50.502: D/dalvikvm(7902): GC_FOR_ALLOC freed 454K, 8% free 8158K/8808K, paused 14ms, total 14ms
02-11 14:46:50.832: D/dalvikvm(7902): GC_FOR_ALLOC freed 451K, 8% free 8163K/8808K, paused 14ms, total 14ms
02-11 14:46:51.172: D/dalvikvm(7902): GC_FOR_ALLOC freed 459K, 8% free 8164K/8808K, paused 13ms, total 13ms
02-11 14:46:51.382: D/dalvikvm(7902): GC_FOR_ALLOC freed 453K, 8% free 8157K/8808K, paused 13ms, total 13ms
02-11 14:46:51.532: D/dalvikvm(7902): GC_FOR_ALLOC freed 445K, 8% free 8163K/8808K, paused 14ms, total 14ms
02-11 14:46:52.992: D/dalvikvm(7902): GC_FOR_ALLOC freed 483K, 8% free 8156K/8808K, paused 13ms, total 13ms
02-11 14:46:54.512: D/dalvikvm(7902): GC_FOR_ALLOC freed 493K, 8% free 8157K/8808K, paused 15ms, total 15ms
02-11 14:46:54.892: D/WLDroidGap(7902): Finished copying files to local storage...
02-11 14:46:54.902: D/WLDroidGap(7902): no need to check web resource integrity
02-11 14:46:54.932: D/CordovaWebView(7902): >>> loadUrl(file:///data/data/com.SeterusSnapShot/files/www/skinLoader.html)
02-11 14:46:54.932: D/PluginManager(7902): init()
02-11 14:46:54.932: D/CordovaWebView(7902): >>> loadUrlNow()
02-11 14:46:55.162: D/CordovaActivity(7902): onMessage(onPageStarted,file:///data/data/com.SeterusSnapShot/files/www/skinLoader.html)
02-11 14:46:55.272: D/chromium(7902): Unknown chromium error: -6
02-11 14:46:55.282: D/CordovaWebViewClient(7902): onPageFinished(file:///data/data/com.SeterusSnapShot/files/www/skinLoader.html)
02-11 14:46:55.282: D/CordovaActivity(7902): onMessage(onPageFinished,file:///data/data/com.SeterusSnapShot/files/www/skinLoader.html)
02-11 14:46:55.472: D/CordovaActivity(7902): onMessage(spinner,stop)
02-11 14:46:55.482: D/CordovaNetworkManager(7902): Connection Type: wifi
02-11 14:46:55.502: D/TilesManager(7902): Starting TG #0, 0x64374730
02-11 14:46:55.502: D/TilesManager(7902): new EGLContext from framework: 59fa6e60
02-11 14:46:55.502: D/GLWebViewState(7902): Reinit shader
02-11 14:46:55.572: D/GLWebViewState(7902): Reinit transferQueue
02-11 14:46:55.572: D/CordovaNetworkManager(7902): Connection Type: wifi
02-11 14:46:55.582: D/CordovaActivity(7902): onMessage(networkconnection,wifi)
02-11 14:46:55.582: D/CordovaWebView(7902): >>> loadUrl(file:///data/data/com.SeterusSnapShot/files/www/default/index.html)
02-11 14:46:55.582: D/PluginManager(7902): init()
02-11 14:46:55.582: D/CordovaWebView(7902): >>> loadUrlNow()
02-11 14:46:55.582: D/CordovaActivity(7902): onMessage(onPageStarted,file:///data/data/com.SeterusSnapShot/files/www/default/index.html)
02-11 14:46:56.522: D/CordovaActivity(7902): onMessage(spinner,stop)
02-11 14:46:56.532: D/CordovaNetworkManager(7902): Connection Type: wifi
02-11 14:46:56.532: D/CordovaActivity(7902): onMessage(networkconnection,wifi)
02-11 14:46:56.532: D/CordovaNetworkManager(7902): Connection Type: wifi
02-11 14:46:56.722: D/CordovaLog(7902): file:///data/data/com.SeterusSnapShot/files/www/default/js/snapShotView.js: Line 18 : XXXXXXXXXXX Entering snapShotList() to setup loan info data.::null
02-11 14:46:56.722: I/Web Console(7902): XXXXXXXXXXX Entering snapShotList() to setup loan info data.::null at file:///data/data/com.SeterusSnapShot/files/www/default/js/snapShotView.js:18
02-11 14:46:56.722: D/CordovaLog(7902): file:///data/data/com.SeterusSnapShot/files/www/default/js/snapShotView.js: Line 31 : XXXXXXXXXXX Appears Local Storage is not setup:: loanNumnber tag does not exist.
02-11 14:46:56.722: I/Web Console(7902): XXXXXXXXXXX Appears Local Storage is not setup:: loanNumnber tag does not exist. at file:///data/data/com.SeterusSnapShot/files/www/default/js/snapShotView.js:31
02-11 14:46:56.732: D/CordovaLog(7902): file:///data/data/com.SeterusSnapShot/files/www/default/js/snapShotView.js: Line 33 : XXXXXXXXXXX Get just created data.::1234567890
02-11 14:46:56.732: I/Web Console(7902): XXXXXXXXXXX Get just created data.::1234567890 at file:///data/data/com.SeterusSnapShot/files/www/default/js/snapShotView.js:33
02-11 14:46:56.732: D/CordovaLog(7902): file:///data/data/com.SeterusSnapShot/files/www/default/js/snapShotView.js: Line 46 : XXXXXXXXXXX Build, or refresh the loan list information
02-11 14:46:56.732: I/Web Console(7902): XXXXXXXXXXX Build, or refresh the loan list information at file:///data/data/com.SeterusSnapShot/files/www/default/js/snapShotView.js:46
02-11 14:46:56.902: D/CordovaWebViewClient(7902): onPageFinished(file:///data/data/com.SeterusSnapShot/files/www/default/index.html)
02-11 14:46:56.902: D/CordovaActivity(7902): onMessage(onPageFinished,file:///data/data/com.SeterusSnapShot/files/www/default/index.html)
02-11 14:46:57.022: D/chromium(7902): Unknown chromium error: -6
02-11 14:46:57.022: D/chromium(7902): Unknown chromium error: -6
02-11 14:46:57.022: D/chromium(7902): Unknown chromium error: -6
02-11 14:46:57.052: D/CordovaLog(7902): file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js: Line 21 : Error: scriptError
02-11 14:46:57.052: E/Web Console(7902): Error: scriptError at file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js:21
02-11 14:46:57.052: D/CordovaLog(7902): file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js: Line 21 : Error: scriptError
02-11 14:46:57.052: E/Web Console(7902): Error: scriptError at file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js:21
02-11 14:46:57.132: D/CordovaLog(7902): file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js: Line 21 : Error: scriptError
02-11 14:46:57.132: E/Web Console(7902): Error: scriptError at file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js:21
02-11 14:46:57.162: D/chromium(7902): Unknown chromium error: -6
02-11 14:46:57.162: D/chromium(7902): Unknown chromium error: -6
02-11 14:46:57.222: D/CordovaLog(7902): file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js: Line 21 : Error: scriptError
02-11 14:46:57.222: E/Web Console(7902): Error: scriptError at file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js:21
02-11 14:46:57.222: D/CordovaLog(7902): file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js: Line 21 : Error: scriptError
02-11 14:46:57.222: E/Web Console(7902): Error: scriptError at file:///data/data/com.SeterusSnapShot/files/www/default/dojo/dojo.js:21
02-11 14:46:57.272: D/dalvikvm(7902): GC_FOR_ALLOC freed 481K, 8% free 8187K/8808K, paused 15ms, total 16ms
02-11 14:46:57.272: W/PluginManager(7902): THREAD WARNING: exec() call to Utils.getScreenSize blocked the main thread for 17ms. Plugin should use CordovaInterface.getThreadPool().
02-11 14:46:57.282: D/CordovaActivity(7902): onMessage(spinner,stop)
02-11 14:46:57.282: D/SeterusSnapShot(7902): wlclient init started
02-11 14:46:57.282: D/SeterusSnapShot(7902): Read cookies: null
02-11 14:46:57.282: D/SeterusSnapShot(7902): CookieMgr read cookies: {}
02-11 14:46:57.322: W/SeterusSnapShot(7902): Your application is using the WL.OptionsMenu API. Note that, if your application targets Android 3.0 (API level 11) or higher, WL.OptionsMenu might have no effect, depending on the device.
02-11 14:46:57.332: D/SeterusSnapShot(7902): addDeviceIDHeader deviceIDSuccessCallback
02-11 14:46:57.352: W/PluginManager(7902): THREAD WARNING: exec() call to Utils.writePref blocked the main thread for 22ms. Plugin should use CordovaInterface.getThreadPool().
02-11 14:46:57.352: D/SeterusSnapShot(7902): connectOnStartup finalizeInit
02-11 14:46:57.362: D/SeterusSnapShot(7902): before: app init onSuccess
02-11 14:46:57.372: D/WLDroidGap(7902): unregisterReceivers:Receiver not registered: null
02-11 14:46:57.372: D/WLDroidGap(7902): unregisterReceivers:Receiver not registered: null
02-11 14:46:57.382: D/SeterusSnapShot(7902): after: app init onSuccess
02-11 14:46:57.382: D/SeterusSnapShot(7902): added onPause event handler
02-11 14:46:57.382: D/SeterusSnapShot(7902): wlclient init success
Worklight 6.1 uses Dojo v1.9.1-20130926, not v1.8.
You can verify this in the dojoLib created for you when adding Dojo to a Worklight project. There is a version.txt file.
There is one relevant error from the LogCat:
scriptError dojo.js:21
Most relevant past questions:
I do not know if the 1.8 was a typo or not, but I would suggest to start afresh with a new Worklight project, following my example below. If this is now working, I suggest to continue onwards from there.
This is what I've done. Let me know if you're doing anything else in specific:
Added the following Dojo widgets: Heading, Button, TextBox, Slider, Carousel, CarouselItem...
In common\js\main.js,
dojoInit()
is auto-updated with the required modules in therequire
function:In both the MBS and simulator/device, I see the same:
MBS:
iOS Simulator/device:
Now if I go to the
Dojo Library Requests
view and uncheckProvide Missing Dojo Resources
and re-run in Xcode, the graphics will then not load. If I re-check the option and re-run in Xcode, the graphics then load again.Missing graphics:
To correct this I needed to re-build the project in Eclipse.
Why?
When building with
Provide Missing Dojo Resources
checked, you will find the following in the HEAD of the generated HTML:<script data-dojo-config="isDebug: false, async: true, parseOnLoad: true, mblHideAddressBar: false" src=http://some-ip-address-and-path/dojo/dojo.js" type="text/javascript"></script>
This
src
URL tells the application to get all Dojo resources from the dojoLib library in the server.When unchecking
Provide Missing Dojo Resources
and re-building the project in Eclipse, thesrc
URL changes todojo/dojo.js
, meaning all resources will be taken from whatever is included in the Dojo library inside the application.