Ionic app shows white screen on android 4 versions

核能气质少年 提交于 2020-02-22 23:14:37

问题


I am developing ionic application which works fine in browser as well in android 5 versions but when i try to install my same apk in andriod 4 versions it simply displays white screen doesnt show up anything.

i had tried installing crosswalk, whitelist and splash screen plugins after installing all plugins i am unable to build. i am attaching the screenshots of installed plugins and build error please help where i am going wrong.

Please find the image where i installed the plugins

Also, Please find the error i am getting while building the app.

Please find the build error image

I am having the following in config.xml file

 <preference name="android-minSdkVersion" value="16" />
 <preference name="android-targetSdkVersion" value="16" />

回答1:


So, i found the solution to this issue.. Installed Crosswalk plugin which adds around 17MB to the app size then i tried installing Crosswalk Lite which worked well.

Here are few things you should look for in your config.xml :
1. <preference name="android-minSdkVersion" value="16"/>

2.Most important is this one : I was using beta version of xwalk earlier

 <preference name="xwalkVersion" value="xwalk_core_library_beta:18+"/>
 <preference name="xwalkMode" value="embedded"/>

gives me apk of size around 33MB where actual app size is 11MB

now i am using canary version

<preference name="xwalkVersion" value="xwalk_core_library_canary:17+" />
<preference name="xwalkMode" value="lite" />

gives me apk of size around 21MB where actual app size is 11MB.

Please refer to thepio answer above it helped alot.




回答2:


Ionic officially supports Android versions 4.1.x and above. Your min SDK version is the required 4.1.x but are you testing on an older Android version like 4.0.x? You could set:

<preference name="android-minSdkVersion" value="15" />
<preference name="android-targetSdkVersion" value="19" />

See this post on the official Ionic blog: http://blog.ionic.io/market-share-movement-android/

EDIT based on your comment:

You should see this great answer on SO

In the answer above they state that you should make sure you have Android Support Repository and Google Repository downloaded because crosswalk plugin is building two apks : one for ARM, the other for x86.



来源:https://stackoverflow.com/questions/37344720/ionic-app-shows-white-screen-on-android-4-versions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!