Search code examples
flutterwebsocketros

Bad state: Insecure HTTP is not allowed by platform: http://0.0.0.0:9090


I'm trying to connect to a Ros WebSocket service at ws://local host:9090 (runned with rosbridge) from my flutter application, but i'm getting the following error in Flutter:

Bad state: Insecure HTTP is not allowed by platform: http://local host:9090


Solution

  • Open the AndroidManifest.xml file in the android/app/src/main folder.

    Then set usesCleartextTraffic to true.

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