Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
333 views
in Technique[技术] by (71.8m points)

flutter - Insecure HTTP is not allowed by platform

I am facing following issue : I/flutter (31349): Bad state: Insecure HTTP is not allowed by platform: http://max-image-caption-generator-test.2886795296-80-host19nc.environments.katacoda.com/model/predict

I added following lines in android/app/src/main/AndroidManifest.xml file

<uses-permission android:name="android.permission.INTERNET" />

<application
android:usesCleartextTraffic="true"
</application>

But still I am facing the error enter image description here

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

HTTP connections are not allowed anymore since Flutter 2.0 on Android and iOS. There are two solutions: You can use only HTTPS connections or you can activate unsecure connections (e.g. for debugging). The following article describes how to do this: https://flutter.dev/docs/release/breaking-changes/network-policy-ios-android or Flutter Insecure http is not allowed by platform


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...