Summary of issues in the various versions of Android Development

Android9.0

Internet problem

Problem Cause: Android P request expressly limits the network traffic, non-encrypted traffic requests are prohibited off system (HTTP), we recommend using HTTPS.

Solution: In the resource file new xml directory, create a file, the file name
network_security_config.xml

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
 <base-config cleartextTrafficPermitted="true" />
</network-security-config>

Open the AndroidManifest.xml file and add the application label
android: networkSecurityConfig = "@ xml / network_security_config"

<application
 android:networkSecurityConfig="@xml/network_security_config">
 </application>

https://zhuanlan.zhihu.com/p/52619909

Released five original articles · won praise 3 · Views 1469

Guess you like

Origin blog.csdn.net/weixin_42968584/article/details/104072125