Ionic2 app show blank screen on android device (4.2.2) using run command and IonicView

Hi Hartingon,

on Debugging below is the error message I see

No Content-Security-Policy meta tag found. Please add one when using the cordova-plugin-whitelist plugin.(anonymous function) @ whitelist.js:24

however i have added ionic plugin add https://github.com/apache/cordova-plugin-whitelist.git
Also I added below tag in config.xml
<allow-navigation href="*" />

Also I added below tag in index.html
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"/>

But problem did not resolve can you please help me on this??

Thanks
Faraaz

same here. android 5 for me

Yes your solution works…U r right…

Exactly same error, feeling so frustrate. It’s not realistic if Android 4.3 is not support.

Ionic 2 supports Android 4.4 and up, if you need to support older versions then you can use Crosswalk:

Can you let me know the steps on installing older android platform api?

crosswalk installed, but still with blank screen on android 4.3, the line exports.raf = (window[window[‘Zone’]symbol] || window[window[‘Zone’]symbol])‘bind’; throw a bind error.

Ionic Framework Version: 2.0.0-beta.3, have no problem.
Ionic Framework Version: 2.0.0-beta.4, the bind problem appeared. looks like it’s not the issue of using crosswalk or not. But the app.bundle.js will have a bind issue “Cannot call method ‘bind’ of undefined”

Ops sorry, got it solved. The reason is that crosswalk is not actually add and compile so, I am not using crosswalk and the latest version got some undefined issue.

With the below environment and crosswalk installed. It’s work.

Your system information:

Cordova CLI: 6.1.1
Ionic Framework Version: 2.0.0-beta.6
Ionic CLI Version: 2.0.0-beta.25
Ionic App Lib Version: 2.0.0-beta.15
OS:
Node Version: v5.11.1

Ok, great, I’m glad you figured it out.

example build with ionic 2.0.0-beta.25 and @angular.rc1 works fine on my LG android 4.0.4 but not on Samsung 4.2.2 (white screen after splash screen)

I have the same problem wiht blank screens after run, installed today the ionic2 beta version. I tried to run tutorial app on an Samsung Android 4.3 and on iPhone 6plus iOS 9.3.4. Both devices show blank s
creen.

today it worked for ios…I installed ios-deploy…made a build…installed typescript and typings which I didn’t…it worked then perfectly on my iPhone 6 Plus…once more tried with Android 4.3 on Samsung still does not work, but I think maybe because this crosswalk is not longer supported for Android 4…maybe this is the reason.

Couldn’t get it to work on my 4.2.2 device or a 4.2.2 emulator either.
After reading royanon answers I tried installing his ionic version with
npm install -g ionic@2.0.0-beta.25
(seriously I didn’t really know what I was doing there, if anybody has a good link for ionic 2 versions it would be appreciated)
That gave me his “ionic info” on a new project and IT WORKED on device.

There was NO DIFFERENCE with or without cordova-plugin-crosswalk-webview.
It appears that newer ionic 2 versions are buggy here, or at least 2.1.0-beta.1 which I had previously.

Does anyone know how to report this issue the correct way?

(EDIT) UPDATE: Seems that there is another new ionic version out: "2.1.0 " notice that theres no beta :wink:
The above issue is fixed but apparently the starter packages changed so they won’t work anymore with older ionic beta versions (gulp removed?)
https://forum.ionicframework.com/t/out-of-the-box-error/64803/6

Off-Topic: I spend the whole day yesterday to make it work on 4.2.2 and today because new projects didn’t work at all anymore with yesterdays solution. Yeah, you get your punishment for using beta, daily… :wink:

Hi,
I am new to ionic flamework.
My main issue is that after upgrade to ionic 2.0.1 my app take to much time to load in an Android device I use to test (LG
L70 with Android4.4.2), comparing with 2.0.0.rc4 , I was using before.

The issue is not reproduced running my app using ionic serve or using an Android emulator.

The issue is seen even with a new app , using “ionic start --v2 myApp tabs” command and build an Android apk.

I think this issue is releted with this one.
I try to test with cordova-plugin-crosswalk-webview, but no luck.

Any ideas ?

Br, Giannis

try > ionic run --prod --device

Hi,
I tried ionic run android --prod --device , since I want to test on Android.
But with no luck - loading time still is too long.
Did anyone know how to get some kind of logs with timestamps, to figure out where my app consumes time (e.g cordova logs)?
Br,
Giannis

Hello @iotriado,

I had the same problem and did the following to fix:

// Installation report version 2
$ Ionic start appName --v2

// Adding the Android platform to the app
$ Ionic Platform add Android

// Installing the webview plug-in to work on older versions of android, the latest version of this plugin no longer supports android version <= 4.1, so v16 should be installed
$ Cordova plugin add cordova-plugin-crosswalk-webview --v16

// Embed the android platform plugin
$ Cordova build android

// Since earlier versions have less memory, put the code below in the config.xml file to increase the response time

// Now just run on the android normally
$ Ionic run Android

I hope I have helped ^^

1 Like

Hi Falkom ,
thanks for your answer.

The main issue I noticed is that ionic cli was not updated to the latest version.
(for some reason ionic was not removed from /usr/local/bin/ , after executing sudo npm uninstall -g ionic - I have to remove it manual - I don’t know why, though!!!).

I think that for better performance you should use
ionic run android –prod (because that apk is rebuild)

And even without cordova-plugin-crosswalk-webview , the initialazation time is about 5 sec, in my android 4.4.2 device.
I guess this time is acceptable. Is it?

Br,
Giannis