简体   繁体   中英

Ionic app works with ios but does not on android

My app works fine with "ionic serve", ionic view and "ionic build ios" on ios device. My app also works fine with ionic view on android. However, when I run "ionic run android" and install the app on android device, it only shows white blank page and does not work.

People seem having similar issues and some possible solutions are discussed here: https://forum.ionicframework.com/t/ionic2-app-show-blank-screen-on-android-device-4-2-2-using-run-command-and-ionicview/39405/17 . However, none of the solutions worked for me. For example, I added crosswalk plugin but did not work.

Does anybody know why it is happening and how to fix it?

Any suggestions will be appreciated. Thanks in advance.

尝试更新离子,如果不起作用,可以通过genymotion读取控制台日志

install the app on android device, it only shows white blank page and does not work.

The big clue in this situation, is down to either a syntax error, missing script, or a dependency injection failure within the app.js .

On the Android platform, it is less forgiving in that aspect, as their chromium browser engine, is far more stricter then what would be on iOS's Webkit engine.

The best weapon of defence is to use a lint tool for javascript, this will catch out the extraneous errors, a recommended way, would be to integrate it into the gulp script as a pre-build task for example, before doing an actual build.

It can work out to be quite painful when doing a build deploy cycle, without using a lint tool, the extra time spent trying to figure out why a white blank screen greets you, only to realize a few minutes later, it was down to a slight mis-spelling.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM