首页 > 解决方案 > Flutter 构建发布 apk 没有健全的 null 安全性?

问题描述

调试 apk 工作正常,发布 apk 不工作..

尝试了颤振构建 apk --no-sound-null-safety 它构建了发布 apk 但不起作用。

标签: flutterflutter-dependenciesflutter-testflutter2.0

解决方案


问题解决!!实际上,问题出在“http”,因为管理面板中没有包含 SSL 证书,因此, Bad state: Insecure HTTP is not allowed by platform在我的 Mi note4 手机中运行时,应用程序在某些设备上显示错误。

在标签内的文件中 添加 android:usesCleartextTraffic="true"了行 AndroidManifest.xml<manifest <application android:usesCleartextTraffic="true""> </application> </manifest>


推荐阅读