Ionic capacitor Android app cannot access internet

前端 未结 1 1296
孤城傲影
孤城傲影 2021-01-21 21:17

This is the versions and configurations as follows,

// package.json

 \"dependencies\": {
    \"@angular/common\": \"~8.2.14\",
    ....
    \"@capacitor/android         


        
相关标签:
1条回答
  • 2021-01-21 21:40

    Android 9 and newer disable http connections by default, so if you want to allow http connections you can add android:usesCleartextTraffic="true" to the application tag in AndroidManifest.xml

    Or if you don't want to allow all http traffic, but just a few urls, check security-config docs: https://developer.android.com/training/articles/security-config#CleartextTrafficPermitted

    0 讨论(0)
提交回复
热议问题