Ionic 2 starter project went white screen, when running in android device


#1

I have tried 4 versions of IONIC 2 starter projects:

  • Tab example in JS
  • Tab example in TS
  • Side menu example in JS
  • Side menu example in TS

All runs well when using the serve command. However, when using the run android command, it went to white screen. I tried disabling the splash screen, it still gives me the white screen.

The project is as is, have not made any modification to it.
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: windows 8.1
Node version: v4.4.3
Mobile phone used: Samsung Galaxy note 1 (the first note). running on android 4.1.2

Please help. Thanks in advance.


#2

If you need to support Android version older than 4.4 then you can use Crosswalk:


#3

Thanks for the reply. but it did not work.

I uses the following link to add crosswalk, but still getting the white screen.

Any other recommendations?


#4

Okay, my bad, crosswalk actually works.

When you compile with crosswalk installed, there will be 3 APKs created.

  • Normal APK
  • APK for armv7
  • APK for x86

When you run the Run android command it will automatically select normal apk, which did not work.

But if you select APK for armv7 (I copy paste to my Samsung and install manually), it will work.

You can find these apk files in the following directory: {{ionic project directory}}/platforms/android/build/outputs/apk/

Hope this helps.


#5

@rwendi I’m glad you figured it out.

AFAIK you can specify in config.xml if multiple APKs should be created with the following preference:

<preference name="xwalkMultipleApk" value="true" />

When using multiple APKs the following links might be also useful:


#6

iignatov, by setting xwalkMultipleApk to false, it only creates 1 working version. Thanks for the tips.