PS D:\flutterApp\myapp> flutter run
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 203.1s (!)
√ Built build\app\outputs\apk\debug\app-debug.apk.
Installing build\app\outputs\apk\app.apk... 7.7s
Error waiting for a debug connection: The log reader stopped unexpectedly
Error launching application on Redmi Note 4.
Earlier it was Error waiting for a debug connection: Bad state: No element
, I switched to master from stable and now it is throwing this error on run. App is getting installed but crashing by throwing this error.
You need to execute flutter clean
command in your project and also make sure the device properly connected, the cable is attached properly. Also, you have to allow permission to launch on an app device and you should see a dialog while launching the app and restart the device...
$ flutter clean
Follow these simple steps
This worked for me.
I was facing the same issue, the problem occurred after I tried to change the package name of my flutter (Android App) may be from the old article. After reverting back the changes i.e setting default"com.example.app" as the package name issue disappears. If someone else is facing the issue, you can follow these two articles 1 or 2. In the first link, you might be having Points 1 & 2 a bit different you may not have any of these two:
File: MainActivity.java Path: /android/app/src/main/java/com/example/app Instead, you can have:
File: MainActivity.kt Path: /android/app/src/main/kotlin/com/example/app
so change accordingly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With