Home > Software engineering >  Flutter problem: Lost connection to device. Plugin implementation?
Flutter problem: Lost connection to device. Plugin implementation?

Time:11-21

I cannot solve this error. The app seems to build just fine but, for some reason, can't seem to connect to the emulator. It always ends with "Lost connection to device" while installing. I also tried it on a physical device, still won't work. I have tried numerous possible solution, but none of them worked.

What I've checked:

  • Memory enough
  • No connection problem
  • flutter doctor -v shows no issues

The problem might be some plugin issue, but I don't know what or how to solve it. It also might be something else. If further code or information is required do let me know. Does anyone know how to solve this issue?

CodePudding user response:

I have two times facing this issue, to fix it sometime it is a bit tricky.

It is coming from 2 possibilities:

  1. Device you are using
  2. Invalid SDK after accidentally updates its version.

But, if the problem is on your device, try this.

  1. Reset the debug authorization on your device Go to settings > developer options > revoke USB debbuging authorization.

If problem persist.

  1. Check the disable adb auth timeout if it unchecked.

  2. Modify the Logger buffer size to max (Mine is set off before, now it is 8MB, and changing this to 64k is working on small apps, but bigger apps need to log the debug process much bigger so it needs to increase its capacity).

Hope this can helps you mate!

CodePudding user response:

What usually fixes it for me is to close the emulator, go into Android Studio Device Manager and 'Wipe Data' for that emulator. See image:

enter image description here

  • Related