Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

flutter given error while running: Error waiting for a debug connection: Bad state: No element

Tags:

flutter

dart

I'm launching the app in a real device. Anyone knows why this is happening?

Launching lib/main.dart on GT I9063T in debug mode...
✓ Built build/app/outputs/apk/debug/app-debug.apk.
Error waiting for a debug connection: Bad state: No element
Error launching application on GT I9063T.
Exited (sigterm)

Even the hello-world app is showing this error.

like image 966
Rafael Áquila Avatar asked Dec 06 '19 12:12

Rafael Áquila


3 Answers

Run flutter clean.

This works for me.

like image 117
Erisan Olasheni Avatar answered Oct 31 '22 03:10

Erisan Olasheni


I had this error with a clean install on MacOS X (Mojave), and after trial and error discovered that the main user who is running flutter debug needs to be an admin user.

Clue was the line:

log: Must be admin to run 'stream' command

when running from command line.

After this VS Code and command line work.

like image 20
gordon Avatar answered Oct 31 '22 04:10

gordon


Build always works on my VS code normally. Updating to the latest Flutter 1.12 also started showing this and most times, my code either shows up on my device first before showing that debug has started or the program just quits. Any fix with VS code because I am not an Android Studio fan.

like image 2
lordvidex Avatar answered Oct 31 '22 02:10

lordvidex