Got this error "Error: ADB exited with code 1" while developing with Flutter


While developing a Flutter app, I received the error; "Error: ADB exited with exit code 1".

Estimated read time : 2 minutes

Jump to

Key takeaways

  • Solution to "Can't find service: activity" while developing Flutter
  • May be caused by multiple app versions in same VM
  • May be fixed by wiping data off the emulator VM

Error: "Can't find service: activity"

I got the following message in the terminal while trying to do hot reload on my Flutter app.

I was using a Pixel 5 VM as emulator through Android Studio.

cmd: Can't find service: activity
Error: ADB exited with exit code 1
Performing Streamed Install

This is how it looked in my terminal:

Solution: Wipe data from VM

The solution I found was that my virtual machine had not only grown in size, from 1 GB to almost 10GB, but I was also using it to test multiple apps simultaneously.

Solution - wipe the data from the virtual machine.

This is how you do it:

1. Open Android Studio

2. Open Virtual Device Manager, that is found under "More actions".

3. Open the Virtual Machine that you want to empty the database from. Important note: Make sure it is not in use. Select Wipe data from the tools menu.

And then you are good to go.

Restart the VM and execute "flutter run" again. Hopefully it solves your problem too.