应用程序不在android 9 Pie只显示黑屏

问题描述 投票:-2回答:1

我的应用程序正在工作,除了在android 9 Pie。我没有在我的应用程序上看到任何错误,一切正常。我没有找到任何关于此错误的解释。

我的应用程序在登录应用程序后出现错误,然后它只显示空白的黑色布局。有没有人会遇到这种错误?请帮我。谢谢。

更新8/3/2019

我找到了答案,它是由android pie的最新要求造成的,即设备无法将数据发送到服务器HTTP而没有将apache.http.legacy设置为andorid:required =“false。

android android-9.0-pie
1个回答
1
投票

我最近对Android 9有同样的问题,但我不得不使用一些URL用于不同的屏幕。所以我添加了android:usesCleartextTraffic =“true”给Manifest并且它有效,但我们不想为此破坏整个应用程序的安全性。所以修复是在更改从HTTP到https.But的链接,如果您只需要使用http与您的应用程序进行通信,那么这是您的解决方案。

Add this in the Manifest file

android:networkSecurityConfig="@xml/security_config"

Add this in the Xml
<network-security-config>
<base-config cleartextTrafficPermitted="true"/>
<debug-overrides>
 <trust-anchors>
    <certificates src="system" />
    <certificates src="user" />
</trust-anchors>
</debug-overrides>
</network-security-config>
© www.soinside.com 2019 - 2024. All rights reserved.