解决Cleartext HTTP traffic to 01.minipic.eastday.com not permitted

Http does not support the plaintext transmission after P Andrews

There are two solutions

1. The application manifest can be added in

 

<application
        ...
        android:usesCleartextTraffic="true"
        ...>
        ...
    </application>

 2. You can then create a new directory res xml folder

Then define a xml file

Entry

<?xml version="1.0" encoding="utf-8"?>
<network-security-config xmlns:android="http://schemas.android.com/apk/res/android">
    <base-config cleartextTrafficPermitted="false"/>
</network-security-config>

The following compilation environment jump to 28

 

android {
    compileSdkVersion 28
    buildToolsVersion "28.0.0"
    defaultConfig {
        applicationId "com.demo.mianshi"
        minSdkVersion 23
        targetSdkVersion 28
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

 

If the above does not work !!!

Please change http to https

Effective pro-test, the simulator is run through in this way, the real machine does not require

Published 137 original articles · won praise 29 · views 110 000 +

Guess you like

Origin blog.csdn.net/xiexiaotian11/article/details/103424569