我已经使用 ionic cordova build android 构建了一个 apk 文件.我已经使用 Genymotion 模拟器打开了该应用程序.当我打开应用程序时,它会启动并显示启动画面.之后永远出现一个白屏(我可以关闭应用程序.但是当我再次启动时,同样的事情会发生).
I have built an apk file using ionic cordova build android. And I have opened that app using Genymotion emulator. When I opened the app, it starts and displays the splash screen. After that a white screen appears forever (I can close the app. But when I start that again, same thing happens).
我在 android studio 控制台中捕获了错误.
I have captured the error in the android studio console.
他们来了,
然后我在那个 apk 中打开了 main.js 文件.在第 40 行,我找到了这段代码.
And then I have opened the main.js file in that apk. In line 40, I have found this code.
然后我浏览了 pages (./pages/scanner/scanner.ts) 文件夹中的scanner.ts.我没有发现任何问题.当我使用 cordova run browser 运行它时它可以工作.
Then I browsed the scanner.ts in pages (./pages/scanner/scanner.ts) folder.
I did not find anything wrong. It works when I run that using cordova run browser.
scanner.ts
以下是有关我的设置的更多信息:
Here are some more information on my setup:
npm list -g --depth=0
+-- babel@6.23.0
+-- babel-cli@6.24.1
+-- cordova@7.0.1
+-- ionic@3.5.0
-- nodemon@1.11.0
Installed platforms:
android 4.0.0
browser 4.1.0
Available platforms:
blackberry10 ~3.8.0 (deprecated)
webos ~3.7.0
windows ~5.0.0
感谢您阅读这篇文章.如果你知道是什么原因造成的.或者如何解决这个问题,请告诉我.
Thanks for reading this post. If you know what causes this. Or how to resolve this issue, Please let me know.
将tsconfig.json中的target值由es6改为es5 有效.
例如.target":es6" >>> target":es5"
Changing the target value in the tsconfig.json from es6 to es5 has worked.
Eg. "target": "es6" >>> "target": "es5"
注意:除非您明确声明,否则此问题不会自动发生在项目中.
Note: This problem will not automatically happen to the project unless you declare that explicitly.
这篇关于显示启动画面后的离子android白屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
Android 上的数字软键盘Numeric Soft Keyboard on Android(Android 上的数字软键盘)
带有软键盘和“返回"的 EditText按钮EditText with soft keyboard and quot;Backquot; button(带有软键盘和“返回的 EditText按钮)
在 Android 上的应用程序中内置自定义“键盘&quoCustom #39;Keyboard#39; built in an application on Android(在 Android 上的应用程序中内置自定义“键盘)
如何使用 phonegap 在 iOS 应用程序中防止键盘上推How to prevent keyboard push up webview at iOS app using phonegap(如何使用 phonegap 在 iOS 应用程序中防止键盘上推 webview)
如何在 Android 的移动网站中强制使用带有数字的How to force keyboard with numbers in mobile website in Android(如何在 Android 的移动网站中强制使用带有数字的键盘)
启动 Activity 时自动弹出键盘Automatic popping up keyboard on start Activity(启动 Activity 时自动弹出键盘)