gpt4 book ai didi

安卓 9 : Cleartext HTTP traffic not permitted in webview

转载 作者:行者123 更新时间:2023-12-05 00:05:52 25 4
gpt4 key购买 nike

我正在使用 webview_flutter 插件加载本地主机上托管的页面(使用 dart 创建的服务器,在手机上)但我得到 net::ERR_CLEARTEXT_NOT_PERMITTED 并且我可以'使服务器成为 HTTPS。

我已经实现了所有解决方案 here但这些都不起作用:

  • 添加 network_security_config.xml 文件
  • 添加 android:usesCleartextTraffic 选项

还有其他解决办法吗?

最佳答案

我是安卓开发者,我来告诉你吧。

打开android list 文件(调试和发布),并添加

android:usesCleartextTraffic="true"

application标签

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

发布文件路径android/app/src/main/AndroidManifest.xml调试文件路径 android/app/src/debug/AndroidManifest.xml

enter image description here

enter image description here

关于安卓 9 : Cleartext HTTP traffic not permitted in webview,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57040443/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com