'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.
Solution 1:[1]
I ended reinstalling flutter sdk.
Ubuntu 16.04 VSCODE
Solution 2:[2]
Run flutter clean.
This works for me.
Solution 3:[3]
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.
Solution 4:[4]
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.
Solution 5:[5]
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".
Solution 6:[6]
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
Solution 7:[7]
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.
Solution 8:[8]
In the 'Developer Options' of my phone, when I changed the 'Select Debug app' option to 'Nothing', the error was solved.
Solution 9:[9]
Try to downgrade the libglvnd package to version 1.2.0 in arch linux.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
