Rafael Áquila
Rafael Áquila

Reputation: 141

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

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.

Upvotes: 13

Views: 13039

Answers (10)

Aiyub Munshi
Aiyub Munshi

Reputation: 71

This started occuring after i updated xcode to 14.1. Simple Restarting mac works with flutter clean

Upvotes: 0

Kyaw Thura
Kyaw Thura

Reputation: 51

Try to downgrade the libglvnd package to version 1.2.0 in arch linux.

Upvotes: 0

Tirth
Tirth

Reputation: 1

In the 'Developer Options' of my phone, when I changed the 'Select Debug app' option to 'Nothing', the error was solved.

Upvotes: 0

Siloé Bezerra Bispo
Siloé Bezerra Bispo

Reputation: 2244

I changed the channel of flutter to the master and works, I was using the stable channel.

You can use the command:

flutter channel master

or just flutter channel to see another channel.

Upvotes: 0

Evandro Pomatti
Evandro Pomatti

Reputation: 15094

Started with Flutter 12. It seems that the user must be admin now.

Rolling back to a previous Flutter version will do for now.

flutter version v1.9.1+hotfix.6

Upvotes: 0

Erisan Olasheni
Erisan Olasheni

Reputation: 2905

Run flutter clean.

This works for me.

Upvotes: 6

Rafael Áquila
Rafael Áquila

Reputation: 141

I ended reinstalling flutter sdk.

Ubuntu 16.04 VSCODE

Upvotes: 0

Code Runner
Code Runner

Reputation: 1028

Try to change flutter channel to beta using "flutter channel beta". it worked for me to fix issue which is because flutter version is updated to "v1.12.13+hotfix.5".

Upvotes: 0

gordon
gordon

Reputation: 43

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.

Upvotes: 4

lordvidex
lordvidex

Reputation: 4068

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.

Upvotes: 2

Related Questions