signalpoint / DrupalGap

An application development kit for Drupal websites.
https://www.drupalgap.org
GNU General Public License v2.0
234 stars 186 forks source link

White Screen of Death (WSOD) #242

Closed antsemot closed 10 years ago

antsemot commented 10 years ago

I've tried running the latest drupalgap app on my device (through Eclipse), but encountered WSOD several times. I just got the source codes from github, and replaced them inside the www directory.

I've tried emulating the same Drupalgap app in Ripple connecting to a Drupal site in my local machine and it works. Steps taken are below:

1) extract Drupalgap zip in www/DrupalSite/DGap 2) change the URL in DGap/app/settings.js (http://localhost/DrupalSite) 3) open up Chrome, Enable Ripple, Apache Cordova 4) app loads

When I tried connecting the same setting to remote sites (using Ripple), it shows bad connection error; emulating in devices through Eclipse gives WSOD. I've used the Drupalgap app downloaded from Google Play to connect to the same sites and it works perfectly.

signalpoint commented 10 years ago

@vetalert First, in Eclipse make sure you are able to install and run the "Hello World" from PhoneGap. That is essential. Once that is working, then try dropping DrupalGap on top of it.

Watch the LogCat message window in Eclipse to see any error messages that DrupalGap may report via console.log(). You'll have to report an error message back, or I won't be able to help.

As far as Ripple not being able to connect to a remote site, you most likely need to launch Chrome with web security disabled (http://www.drupalgap.org/node/223), and then "Disable" the "Cross Domain Proxy" under Ripple's settings.

antsemot commented 10 years ago

1) Phonegap runs fine. I emulated the app on Nexus 7 device and it works.

2) Here are the log that I retrieved from LogCat after putting DrupalGap on top of the app:-


04-10 11:45:54.398: D/CordovaActivity(1912): Resuming the App 04-10 11:45:54.398: D/CordovaActivity(1912): CB-3064: The errorUrl is null 04-10 11:45:54.408: D/CordovaNetworkManager(1912): Connection Type: wifi 04-10 11:45:54.408: D/CordovaActivity(1912): onMessage(networkconnection,wifi) 04-10 11:45:54.418: D/SoftKeyboardDetect(1912): Ignore this event 04-10 11:45:54.438: D/OpenGLRenderer(1912): Enabling debug mode 0 04-10 11:45:54.448: D/SoftKeyboardDetect(1912): Ignore this event 04-10 11:45:54.488: D/CordovaActivity(1912): onMessage(onPageStarted,file:///android_asset/www/index.html) 04-10 11:45:54.578: D/CordovaLog(1912): file:///android_asset/www/index.html: Line 7 : Viewport target-densitydpi is not supported. 04-10 11:45:54.578: I/chromium(1912): [INFO:CONSOLE(7)] "Viewport target-densitydpi is not supported.", source: file:///android_asset/www/index.html (7) 04-10 11:45:54.908: D/SoftKeyboardDetect(1912): Ignore this event 04-10 11:45:55.439: D/CordovaWebViewClient(1912): onPageFinished(file:///android_asset/www/index.html) 04-10 11:45:55.439: D/CordovaActivity(1912): onMessage(onPageFinished,file:///android_asset/www/index.html) 04-10 11:45:55.499: D/dalvikvm(1912): GC_FOR_ALLOC freed 276K, 4% free 9209K/9520K, paused 15ms, total 15ms 04-10 11:45:55.619: D/CordovaActivity(1912): onMessage(spinner,stop) 04-10 11:45:55.629: D/CordovaNetworkManager(1912): Connection Type: wifi 04-10 11:45:55.659: I/chromium(1912): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported 04-10 11:45:55.699: I/chromium(1912): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported 04-10 11:45:55.709: E/qdutils(1912): FBIOGET_FSCREENINFO failed 04-10 11:45:55.739: I/App(1912): WARNING: Back Button Default Behavior will be overridden. The backbutton event will be fired! 04-10 11:45:55.749: W/IceCreamCordovaWebViewClient(1912): URL blocked by whitelist: http://biodiversity.fbb.utm.my/myrice//?q=services/session/token 04-10 11:45:55.759: D/CordovaLog(1912): file:///android_asset/www/jdrupal-7.x-1.0-rc2.min.js: Line 28 : http://biodiversity.fbb.utm.my/myrice//?q=services/session/token - 404 - Not Found 04-10 11:45:55.759: I/chromium(1912): [INFO:CONSOLE(28)] "http://biodiversity.fbb.utm.my/myrice//?q=services/session/token - 404 - Not Found", source: file:///android_asset/www/jdrupal-7.x-1.0-rc2.min.js (28) 04-10 11:45:55.759: D/CordovaLog(1912): file:///android_asset/www/jdrupal-7.x-1.0-rc2.min.js: Line 28 : 04-10 11:45:55.759: I/chromium(1912): [INFO:CONSOLE(28)] "", source: file:///android_asset/www/jdrupal-7.x-1.0-rc2.min.js (28) 04-10 11:45:57.441: D/CordovaActivity(1912): onMessage(spinner,stop)


signalpoint commented 10 years ago

It looks like this is the problem:

04-10 11:45:55.749: W/IceCreamCordovaWebViewClient(1912): URL blocked by whitelist: http://biodiversity.fbb.utm.my/myrice//?q=services/session/token

Google why your Emulator would "URL blocked by whitelist", and that should get you past the problem.

Also, in your settings.js file, verify you don't have a trailing slash at the end of the 'site_path' variable.

antsemot commented 10 years ago

Hello @signalpoint. I've managed to solve the URL problem by doing a clean install of the app. Probably something was amiss during the previous installation. However every time I ty running the app on my device (Nexus 7), it says 'no connection'. Here are the logs :-

onPageFinished(file:///android_asset/www/index.html#offline) 04-13 12:09:30.526: D/CordovaActivity(12200): onMessage(onPageFinished,file:///android_asset/www/index.html#offline) 04-13 12:11:21.945: I/CordovaLog(12816): Changing log level to DEBUG(3) 04-13 12:11:21.945: I/CordovaLog(12816): Found start page location: index.html 04-13 12:11:21.945: D/Whitelist(12816): Unlimited access to network resources 04-13 12:11:21.945: D/CordovaActivity(12816): CordovaActivity.onCreate() 04-13 12:11:21.965: V/WebViewChromium(12816): Binding Chromium to the background looper Looper (main, tid 1) {41e62590} 04-13 12:11:21.965: I/chromium(12816): [INFO:library_loader_hooks.cc(112)] Chromium logging enabled: level = 0, default verbosity = 0 04-13 12:11:21.965: I/BrowserProcessMain(12816): Initializing chromium process, renderers=0 04-13 12:11:21.975: W/chromium(12816): [WARNING:proxy_service.cc(888)] PAC support disabled because there is no system implementation 04-13 12:11:21.975: I/Adreno-EGL(12816): : EGL 1.4 QUALCOMM Build: I0404c4692afb8623f95c43aeb6d5e13ed4b30ddbDate: 11/06/13 04-13 12:11:22.035: D/CordovaWebView(12816): CordovaWebView is running on device made by: asus 04-13 12:11:22.035: D/JsMessageQueue(12816): Set native->JS mode to 2 04-13 12:11:22.045: D/CordovaActivity(12816): CordovaActivity.init() 04-13 12:11:22.045: D/CordovaWebView(12816): >>> loadUrl(file:///android_asset/www/index.html) 04-13 12:11:22.045: D/PluginManager(12816): init() 04-13 12:11:22.045: D/CordovaWebView(12816): >>> loadUrlNow() 04-13 12:11:22.085: I/CordovaLog(12816): Changing log level to DEBUG(3) 04-13 12:11:22.085: I/CordovaLog(12816): Found start page location: index.html 04-13 12:11:22.085: D/Whitelist(12816): Unlimited access to network resources 04-13 12:11:22.085: D/CordovaActivity(12816): Resuming the App 04-13 12:11:22.085: D/CordovaActivity(12816): CB-3064: The errorUrl is null 04-13 12:11:22.095: D/SoftKeyboardDetect(12816): Ignore this event 04-13 12:11:22.125: D/OpenGLRenderer(12816): Enabling debug mode 0 04-13 12:11:22.175: D/SoftKeyboardDetect(12816): Ignore this event 04-13 12:11:22.195: D/CordovaActivity(12816): onMessage(onPageStarted,file:///android_asset/www/index.html) 04-13 12:11:22.316: D/CordovaLog(12816): file:///android_asset/www/index.html: Line 7 : Viewport target-densitydpi is not supported. 04-13 12:11:22.316: I/chromium(12816): [INFO:CONSOLE(7)] "Viewport target-densitydpi is not supported.", source: file:///android_asset/www/index.html (7) 04-13 12:11:23.206: D/CordovaWebViewClient(12816): onPageFinished(file:///android_asset/www/index.html) 04-13 12:11:23.206: D/CordovaActivity(12816): onMessage(onPageFinished,file:///android_asset/www/index.html) 04-13 12:11:23.287: D/dalvikvm(12816): GC_FOR_ALLOC freed 268K, 4% free 9221K/9524K, paused 20ms, total 20ms 04-13 12:11:23.357: D/CordovaActivity(12816): onMessage(spinner,stop) 04-13 12:11:23.397: I/chromium(12816): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported 04-13 12:11:23.447: I/chromium(12816): [INFO:async_pixel_transfer_manager_android.cc(56)] Async pixel transfers not supported 04-13 12:11:23.467: E/qdutils(12816): FBIOGET_FSCREENINFO failed 04-13 12:11:23.507: I/App(12816): WARNING: Back Button Default Behavior will be overridden. The backbutton event will be fired! 04-13 12:11:23.517: D/CordovaLog(12816): file:///android_asset/www/bin/drupalgap.js: Line 603 : drupalgap_check_connection - TypeError: Cannot read property 'type' of undefined 04-13 12:11:23.517: I/chromium(12816): [INFO:CONSOLE(603)] "drupalgap_check_connection - TypeError: Cannot read property 'type' of undefined", source: file:///android_asset/www/bin/drupalgap.js (603) 04-13 12:11:23.557: D/dalvikvm(12816): GC_FOR_ALLOC freed 169K, 4% free 9170K/9524K, paused 10ms, total 10ms 04-13 12:11:23.557: I/dalvikvm-heap(12816): Grow heap (frag case) to 9.250MB for 279056-byte allocation 04-13 12:11:23.567: D/dalvikvm(12816): GC_FOR_ALLOC freed 2K, 4% free 9440K/9800K, paused 11ms, total 11ms 04-13 12:11:25.198: D/CordovaActivity(12816): onMessage(spinner,stop) 04-13 12:11:25.879: W/InputEventReceiver(12816): Attempted to finish an input event but the input event receiver has already been disposed. 04-13 12:11:26.069: D/CordovaWebViewClient(12816): onPageFinished(file:///android_asset/www/index.html#offline) 04-13 12:11:26.069: D/CordovaActivity(12816): onMessage(onPageFinished,file:///android_asset/www/index.html#offline) 04-13 12:11:26.069: D/CordovaWebViewClient(12816): onPageFinished(file:///android_asset/www/index.html#offline) 04-13 12:11:26.069: D/CordovaActivity(12816): onMessage(onPageFinished,file:///android_asset/www/index.html#offline)

I reckon this is the problem:

04-13 12:11:23.517: D/CordovaLog(12816): file:///android_asset/www/bin/drupalgap.js: Line 603 : drupalgap_check_connection - TypeError: Cannot read property 'type' of undefined 04-13 12:11:23.517: I/chromium(12816): [INFO:CONSOLE(603)] "drupalgap_check_connection - TypeError: Cannot read property 'type' of undefined", source: file:///android_asset/www/bin/drupalgap.js (603)

I've tried emulating on devices and genymotion. Both throws the same error "offline: No connection found!". The page says

"Failed Connection: Oops! We couldn't connect to:

undefined"

antsemot commented 10 years ago

Updates:

I've replaced the drupalgap.js file with the latest one, and instead of "Failed Connection: Oops! We couldn't connect to:

undefined"

it says

"Failed Connection: Oops! We couldn't connect to:

http://biodiversity.fbb.utm.my/myrice"

antsemot commented 10 years ago

Updates:

Issue solved. Drupalgap on remote website is not installed properly. Did a clean reinstall and now everything works. Thanks!

signalpoint commented 10 years ago

@vetalert - thanks for the updates, I'm glad it is working now. I'll add notes about trying a clean re-install of the module to the troubleshooting guide.