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

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

2 minutes

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

Migrated article

This article was migrated from an older iteration of our website, and it could deviate in design and functionality.

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.

Last updated: 2022-08-24