After Android 9.0, the default http:// request is not supported

After Android 9.0, the default http:// request is not supported

reason

Citation The usesCleartextTraffic attribute in the application node in AndroidManifest.xml before Android 9.0 is true by default, but after 9.0, it is changed to false. You need to let the developer use the encrypted request address https.

solution

1. Use https address.

2. Add the following attributes to the application node in AndroidManifest.xml

android:usesCleartextTraffic = true

Guess you like

Origin blog.csdn.net/yanwenyuan0304/article/details/117298549