美文网首页
Insecure HTTP is not allowed by

Insecure HTTP is not allowed by

作者: ChaosHeart | 来源:发表于2021-09-01 15:21 被阅读0次
Android端

打开android/app/src/main/AndroidManifest.xml这个文件
然后找到:

    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="flutter_demo"
        android:icon="@mipmap/ic_launcher">

这几行代码, 改成

    <uses-permission android:name="android.permission.INTERNET" />
    <application
        android:name="io.flutter.app.FlutterApplication"
        android:label="flutter_demo"
        android:usesCleartextTraffic="true"
        android:icon="@mipmap/ic_launcher">

iOS端

用Xcode打开

然后将plist文件改为

或者直接将plist文件的sourceCode中添加:

    <key>NSAppTransportSecurity</key>
    <dict>
            <key>NSAllowsArbitraryLoads</key>
            <true/>
    </dict>

参考:
https://www.jianshu.com/p/04531025d069

相关文章

网友评论

      本文标题:Insecure HTTP is not allowed by

      本文链接:https://www.haomeiwen.com/subject/pnqxwltx.html