Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On running default app, Flutter throws" log reader stopped unexpectedly" after switching to Master

Tags:

flutter

dart

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.

like image 328
Ajay Tom George Avatar asked Mar 17 '20 19:03

Ajay Tom George


3 Answers

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
like image 88
Ali Fitroni Avatar answered Oct 16 '22 22:10

Ali Fitroni


Follow these simple steps

  1. Disconnect your device
  2. Clear Cache data of your device(Mobile)'s File Manager App
  3. Run flutter clean
  4. Connect your device and run the app

This worked for me.

like image 13
Umang Donda Avatar answered Oct 16 '22 23:10

Umang Donda


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.

like image 9
Mayank chauhan Avatar answered Oct 16 '22 23:10

Mayank chauhan