【问题标题】:ionic application is not working in real device android 9 when it is downloaded from playstore从 Playstore 下载离子应用程序时,它无法在真实设备 android 9 中运行
【发布时间】:2020-01-24 11:40:07
【问题描述】:

我使用 ionic 4 和 ionic 3 开发了一个应用程序。当我使用 ionic cordova run android 安装它时它运行良好,它也适用于所有版本的 android 。但在将其上传到 playstore 后,该应用程序无法在 android 9 手机上运行,​​对服务器的请求没有发生

我尝试将我的 android 平台更改为 8.0.0 但它不起作用,

我还尝试在 AndroidManifest.xml 中为应用程序选择器添加 android:usesCleartextTraffic="true",当我尝试从 playstore 下载它时,应用程序完全崩溃了。

【问题讨论】:

  • 当你的意思是完全崩溃时,它是空白运行还是不运行并关闭?您是否能够从 localhost 以 --prod 模式调试您的应用程序,以查看它是否完美打开并且您在运行时没有遇到模块加载问题?
  • 它甚至没有在我使用的 ionic 4 应用程序中运行,android:usesCleartextTraffic="true" 在 config.xml 和 ionic 3 中它已成功加载并且没有通过 http 请求连接到服务器。

标签: node.js mongodb ionic-framework


【解决方案1】:

将您的 Ionic CLI 更新到最新版本,然后运行以下命令:

ionic cordova run android -l

之后,您需要使用精确提取更新您的 config.xml:

 <access origin="*" />
    <edit-config file="app/src/main/AndroidManifest.xml" mode="merge" target="/manifest/application">
    <application android:usesCleartextTraffic="true" />
</edit-config>

或者,添加:

<allow-navigation href="*" /> 

【讨论】:

  • 我试过了,但是从 google playstore 下载时应用崩溃了
猜你喜欢
  • 1970-01-01
  • 2019-12-01
  • 1970-01-01
  • 2021-03-05
  • 1970-01-01
  • 1970-01-01
  • 2019-11-20
  • 2014-09-01
  • 2013-05-13
相关资源
最近更新 更多