flutter unhandled exception: bad state: insecure http is not allowed by platform:

For Android:
This behavior may be omitted following migration guide: https://flutter.dev/docs/release/breaking-changes/network-policy-ios-android.

or... Just add in android/app/src/main/AndroidManifest.xml:

android:usesCleartextTraffic="true" to <application /> also dont forget to take INTERNET PERMISSION:

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

<application
        android:name="io.flutter.app.FlutterApplication"
        android:label="receipt"
        android:usesCleartextTraffic="true" <!-- This Line -->
        android:icon="@mipmap/ic_launcher">
For iOS:
Allow insecure/HTTP requests globally across your application on iOS, you can add this to your ios/Runner/info.plist under the main dictionary definition:

<key>NSAppTransportSecurity</key>
<dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
</dict>
Be warned that you will need to have an explanation for Apple's review team when enabling this, otherwise your app will get rejected on submission.

Thank you

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://192.168.0.103/parking/backend/bike_master.php [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://10.0.2.2/api/v1/users [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform There was an error causing connection lost: Bad state: Insecure HTTP is not allowed by platform: StateError (Bad state: Insecure HTTP is not allowed by platform: http:// error bad state insecure http is not allowed by platform flutter error Bad state: Insecure HTTP is not allowed by platform:flutter error Bad state: Insecure HTTP is not allowed by platform: Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://10.0.2.2:8001/ flutter StateError (Bad state: Insecure HTTP is not allowed by platform: http: bad state: insecure http is not allowed by platform flutter error Bad state: Insecure HTTP is not allowed by platform ios flutter bad state: insecure http is not allowed flutter unhandled exception bad state insecure http is not allowed by platform in flutter Bad state: Insecure HTTP is not allowed by platform in flutter Login api fail. Bad state: Insecure HTTP is not allowed in flutter Bad state: Insecure HTTP is not allowed by platform: in ios Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://api.atrule.com/api/MehndiDesign Bad state: Insecure HTTP is not allowed by platform: http://10.0.2.2:3000 flutter Bad state: Insecure HTTP is not allowed by platform: flutter StateError (Bad state: Insecure HTTP is not allowed by platform: ) StateError (Bad state: Insecure HTTP is not allowed by platform: flutter StateError (Bad state: Insecure HTTP is not allowed by platform: http://10.0.2.2:8000/api/profile/add/) flutter StateError (Bad state: Insecure HTTP is not allowed by platform: http://10.0.2.2:8000/api/profile/add/) bad state: insecure http is not allowed by platform in flutter Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://10.0.2.2:5000/insert Exception has occurred. StateError (Bad state: Insecure HTTP is not allowed by platform: http://192.168.43.104/flutter_crud/getdata.php) flutter StateError (Bad state: Insecure HTTP is not allowed by platform:) StateError (Bad state: Insecure HTTP is not allowed by platform:) Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://192.168.68.105:8000/api/v1/login Error: Bad state: Insecure HTTP is not allowed by platform: StateError (Bad state: Insecure HTTP is not allowed by platform ios dio Bad state: Insecure HTTP is not allowed by platform flutter state error (bad state insecure http is not allowed by platform bad state insecure http is not allowed flutter Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform ios Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://10.0.2.2:5000/api/register Bad state: Insecure HTTP is not allowed by platform: in flutter bad state: insecure http is not allowed by platform android flutter StateError (Bad state: Insecure HTTP is not allowed by platform) StateError (Bad state: Insecure HTTP is not allowed by platform) Bad state: Insecure HTTP is not allowed by platform ios Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://192.168.0.101:8080/signin Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://harikajobalert.co.in/api/user/login site:stackoverflow.com Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http:// &quot;harikajobalert.&quot; co.in/api/user/login unhandled exception bad state insecure http is not allowed by platform flutter site:stackoverflow.com Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://harikajobalert.co.in/api/user/login StateError (Bad state: Insecure HTTP is not allowed by platform: http: bad state insecure http is not allowed by platform flutter ios Bad state: Insecure HTTP is not allowed by platform: http bad state insecure http is not allowed by platform dio flutter Bad state: Insecure HTTP is not allowed by platform: http://192.168.0.103/api/data/ADMIN flutter Bad state: Insecure HTTP is not allowed by platform: h Bad state: Insecure HTTP is not allowed by platform:FLUTTER flutter dio bad state: insecure http is not allowed by platform Exception: Bad state: Insecure HTTP is not allowed by platform: Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://172.25.192.1:8080/login StateError (Bad state: Insecure HTTP is not allowed by platform: http://10.0.2.2/ StateError (Bad state: Insecure HTTP is not allowed by platform: http://10.0.2.2/appt/test.php) Caught Error : Bad state: Insecure HTTP is not allowed by platform StateError (Bad state: Insecure HTTP is not allowed bad state insecure http is not allowed by platform in flutter Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: flutter error Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://192.168.43.185:5000/api/todos flutter error I/flutter (16546): Bad state: Insecure HTTP is not allowed by platform: http: I/flutter (16546): Bad state: Insecure HTTP is not allowed by platform flutter StateError (Bad state: Insecure HTTP is not allowed by platform: Caught error: Bad state: Insecure HTTP is not allowed by platform: bad state insecure http is not allowed by platform http //10.0.2.2 flutter bad state insecure http is not allowed by platform http //10.0.2.2 flutter Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform Bad state: Insecure HTTP is not allowed by platform dio Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform flutter StateError (Bad state: Insecure HTTP is not allowed by platform: (Bad state: Insecure HTTP is not allowed by platform: Dart Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: Dart Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: dart Dart Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://10.0.2.2:8080 Exception has occurred. StateError (Bad state: Insecure HTTP is not allowed by platform: Flutter Bad state: Insecure HTTP is not allowed by platform HTTP Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http flutter Bad state: Insecure HTTP is not allowed by platform: http:// flutter Bad state: Insecure HTTP is not allowed by platform: http://172.16.10.85:5000/partners fluttercBad state: Insecure HTTP is not allowed by platform: http://172.16.10.85:5000/partners bad state: insecure http is not allowed by platform flutter android bad state:insecure http is not allowed by platform flutter bad state:insecure http is not allowed by platform flutter Bad state: Insecure HTTP is not allowed by platform 10.0.2.2 dio flutter Bad state: Insecure HTTP is not allowed by platform 10.0.2.2 Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://192.168.1.11:5555/api/clients/login flutter Insecure HTTP is not allowed by platform: StateError (Bad state: Insecure HTTP is not allowed by platform: http://ip-api.com/json) error: Bad state: Insecure HTTP is not allowed by platform flutter error: Bad state: Insecure HTTP is not allowed by platform flutter IoClient Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: flutter IcClient Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: unhandled exception: bad state: insecure http is not allowed by platform flutter ios bad state : Insecure Http is not allowed by platform Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: flutter flutter Bad state: Insecure HTTP is not allowed by platform: [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: flutter: Bad state: Insecure HTTP is not allowed by platform: flutter Bad state: Insecure HTTP is not allowed by platform bad state insecure http is not allowed by platform flutter bad state insecure http is not allowed by platform Bad state: Insecure HTTP is not allowed by platform: in flutter dio Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://192.168.43.197:8112/json flutter Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://192.168.43.197:8112/json stateerror (bad state insecure http is not allowed by platform flutter StateError (Bad state: Insecure HTTP is not allowed by platform Bad state: Insecure HTTP is not allowed by platform: unhandled exception bad state insecure http is not allowed by platform flutter ios Bad state: Insecure HTTP is not allowed by platform unhandled exception bad state insecure http is not allowed by platform flutter Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform Bad state: Insecure HTTP is not allowed by platform flutter unhandled exception: bad state: insecure http is not allowed by platform: Unhandled Exception: Bad state: Insecure HTTP is not allowed by platform: http://192.168.43.71/flutter-login-signup/dropdown.php flutter unhandled exception: bad state: insecure http is not allowed by platform:
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source