3

I'm deploying a web app with phonegap to the plataforms: iOS and Android.

I can deploy both, but when the app starts, on the android emulator (also, with any physic device that i've used it to test the application), it stays with a white/blank canvas. Forever.

Initially, i thought it was javascript related, although i don't think it makes sense, since i don't have the same problem with iOS (but i know, it could be browser related).

I've research this problem through the internet, but any possible solution that probably would make sense, didn't work for me.

Solutions i tried:

PhoneGap Build iOS app has blank white screen after splash screen

The Phonegap Version i'm using is: v3.3.0

Also, i'm using a Javascript framework: Dojo, v1.9

Community
  • 1
  • 1
nffdiogosilva
  • 867
  • 1
  • 9
  • 15
  • If your application uses OR need whitelist plugin, please see http://stackoverflow.com/a/34371334/1923045 – Midhun KM Dec 19 '15 at 13:35

2 Answers2

2

My tl;dr answer is...debug that thing with Weinre:

http://people.apache.org/~pmuellr/weinre/docs/latest/

Weinre is very similar to the Chrome/Safari inspector, only for remote browsers (such as the native WebView!). Pretty sweet, eh? It involves a little setup but has been well worth it for me. Interactively test your assumptions and see your console.log statements print out in a far superior fashion than with logcat (in the android case).


Some reflections on the matter:

Developing my app over the last couple months, I've encountered the blank screen tons of times. It is never the same issue twice, for me it always something I have broken during development.

For example, not adding a Cordova plugin via the command line but trying to reference the plugin in my app's javascript logic.

Another example is not having proper Cross Origin stuff setup on the server and the initial ajax call that worked fine on desktop/localhost suddenly doesn't work once deployed to the device and it just craps out (giving the white screen).

Another example from the other day was trying to see if I could get away with using Sencha on Android as old as 2.3, which in my case, you guessed it gave me a white screen. Maybe Dojo has a similar issue?


As requested, the settings in my current config.xml that works fine on both iOS and Android

<preference name="permissions" value="none" />
<preference name="orientation" value="portrait" />
<preference name="target-device" value="universal" />
<preference name="fullscreen" value="false" />
<preference name="webviewbounce" value="true" />
<preference name="prerendered-icon" value="true" />
<preference name="stay-in-webview" value="false" />
<preference name="ios-statusbarstyle" value="black-opaque" />
<preference name="detect-data-types" value="true" />
<preference name="exit-on-suspend" value="false" />
<preference name="show-splash-screen-spinner" value="true" />
<preference name="auto-hide-splash-screen" value="true" />
<preference name="disable-cursor" value="false" />
<preference name="android-minSdkVersion" value="7" />
<preference name="android-installLocation" value="auto" />

Hope this helps.

SoldierOfFortran
  • 782
  • 1
  • 7
  • 14
  • I had heard about Weinre (yes, it's pretty cool ^^), and I had used it, but to be honest I didn't give it a fair chance. I'm now, though. And what makes me more confused about it, is that i don't get any output on the console log of some error whatsoever. That is what bores me the most, when debugging some Javascript code. Could you show me a basic config.xml file. Only the Android configurations. I have a feeling it has something to do with SplashScreen or something like that. – nffdiogosilva Mar 21 '14 at 11:50
  • The only difference in your preferences, compared to mine, was the fullscreen option. And despite I had changed that "flag" the problem still persists. I have no doubt, now, that it's **javascript** related. I have posted a new question with a more detailed information about the problem. Please, care to take a look if you have time: http://stackoverflow.com/questions/22565988/how-to-solve-android-phonegap-app-syntaxerror-parse-error-blank-screen-issue – nffdiogosilva Mar 24 '14 at 12:13
0

Phonegap 6.3 scaffholding (phonegap create) is wrong: density should be replaced by qualifier in config.xml. See https://medium.com/@jlchereau/how-to-get-splash-screens-to-show-in-android-apps-generated-by-phonegap-build-c0210f2783ff.

Jack
  • 1