ionic 3: 设备上的安卓应用黑屏 [英] ionic 3: black screen with Android App on device

查看:25
本文介绍了ionic 3: 设备上的安卓应用黑屏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天,我在我的 Android 设备上构建并运行了我的应用,这个版本运行良好.

Yesterday, I built and run my app on my Android device and this version worked fine.

自从我改进了我的应用程序(一些模块的内容视图和控制器),今天,我的设备出现黑屏.

Since, I improved my app (content view and controller of some modules) and today, I have a black screen on device.

  • 当我执行ionic serve
  • 当我构建另一个 Ionic 应用程序(不是这个)并在设备上运行时
  • 当我执行 ionic cordova run android --debug
  • 当我使用与昨天相同的版本时
  • 当我尝试重建已标记的版本时(如此合格并经过测试)

我认为我的构建配置可能已损坏,但我不知道是怎么回事.

I think that maybe my build configuration is corrupted but I don't know how.

我试图:

  • 删除并重新添加 Android 平台
  • 重新安装所有 NPM 模块

但这些步骤都不能解决问题.

but nothing these steps does not fix the issue.

在设备上,我无法访问 Chrome 的检查设备"工具来查看我是否有 JS 问题.

On device, I can't access to "Inspect device" tool of Chrome to see if I have JS problem.

您有什么想法可以解决我的问题吗?

Do you have any idea to resolve my problem please?

经过多次测试,我发现了以下行为:

After more tests, I found the following behavior:

如果我在 config.xml 中更改 的 ID,应用程序在设备上运行良好!

If I change the ID of <widget id="new-app-id"> in config.xml, app runs fine on device!

对这种行为有什么想法吗?

Any idea on this behavior?

谢谢!

推荐答案

经过多次测试和研究,我找到了根本原因,可以解决问题.

After many tests and research, I found the root cause and can solve the issue.

删除插件cordova-plugin-facebook4,并用SDK VERSION重新添加到4.35.0对于较旧的 cordova-android 版本,版本应按照这里

Remove the plugin cordova-plugin-facebook4 and re-add it with SDK VERSION to 4.35.0 For older cordova-android version, the version shall be defined as described here

所以,运行:

ionic cordova plugin remove cordova-plugin-facebook4
ionic cordova plugin add cordova-plugin-facebook4 --variable APP_ID="<APP-ID>" --variable APP_NAME="<APP-NAME>" --variable ANDROID_SDK_VERSION="4.35.0"

根本原因

如本帖子中所述、Facebook SDK 4.36.0版本不稳定导致卡在主线程中.

Root cause

As decribed in this post, Facebook SDK version 4.36.0 is not stable and causes the stuck in main thread.

此行为在我的应用程序上可见(使用 Android SDK 的监控工具")

This behavior is visible on my App (with "monitor tools" of Android SDK)

这篇关于ionic 3: 设备上的安卓应用黑屏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆