0
votes

I am testing the newest Worklight Studio v6.1.0 and have tried to create a hybrid application using the Dojo Toolkit.

I simply created the project using the wizard, added the Android environment and tried to run it in an Android device (Nexus 4).

After the splash image, I got an error on screen. The logcat shows the following:

    12-15 19:28:39.984: D/CordovaActivity(25967): onMessage(spinner,stop)
12-15 19:28:39.994: D/CordovaNetworkManager(25967): Connection Type: wifi
12-15 19:28:39.994: D/CordovaNetworkManager(25967): Connection Type: wifi
12-15 19:28:39.994: D/CordovaActivity(25967): onMessage(networkconnection,wifi)
12-15 19:28:40.855: D/CordovaActivity(25967): onMessage(spinner,stop)
12-15 19:28:44.439: D/CordovaLog(25967): file:///data/data/com.TesteApp/files/www/default/worklight/cordova.js: Line 1097 : deviceready has not fired after 5 seconds.
12-15 19:28:44.439: I/chromium(25967): [INFO:CONSOLE(1097)] "deviceready has not fired after 5 seconds.", source: file:///data/data/com.TesteApp/files/www/default/worklight/cordova.js (1097)
12-15 19:28:44.439: D/CordovaLog(25967): file:///data/data/com.TesteApp/files/www/default/worklight/cordova.js: Line 1090 : Channel not fired: onDOMContentLoaded
12-15 19:28:44.439: I/chromium(25967): [INFO:CONSOLE(1090)] "Channel not fired: onDOMContentLoaded", source: file:///data/data/com.TesteApp/files/www/default/worklight/cordova.js (1090)
12-15 19:28:59.245: E/CordovaWebView(25967): CordovaWebView: TIMEOUT ERROR!
1
Can this question be resolved? - Idan Adar

1 Answers

1
votes

Try the following in order to overcome this issue:

  1. In Eclipse, press ctrl+3 (or cmd+3 if in Mac) and add the Dojo Library Requests view
  2. Un-check the play-like button in the right side of the view
  3. Re-build your project
  4. Test in your device

It should now work.


Background:
A Worklight-based Dojo app, by default, has the Provide Missing Dojo Resources option enabled.

The assumption is that while developing the application, it is being tested in the constraints of the IDE (meaning the Worklight Development Server). The app uses this option to point to the DojoLib that is on the server.

Even if you deploy to a device, it will still work as long as you keep the server running (meaning as long as Eclipse is open).
If you want to test on a device and simulate a real-life scenario where resources are not provided by the DojoLib in the server, then you must uncheck the Provide Missing Dojo Resources option (like in my instructions above).

You are experiencing this error perhaps due to a network issue, where the IP address used to connect to the server by the app (for the DojoLib, not for Worklight Server) is inaccessible and this is something you should check. The IP address that is used can be found in the HEAD element of the generated HTML file at android\native\assets\www\default.

enter image description here

To learn more about the process of providing missing Dojo resources, read this IBM Worklight Information Center topic.