Problem
Uninstalling the app from the home page would cause subsequent flutter run
commands to hang at the installing stage.
Running with flutter run -v
showed that it installed successfully but the activity would not run when adb tried to run it.
Error output
The error message was class 3 ${packageName}/${packagName}.MainActivity
not found.
Hacky fix
Changing the android app package name would cause it to work again until I uninstalled it manually from the phone.
Steps that did not work
- Rebooting the phone multiple times
flutter clean
didn’t work- Restarting Android studio
- Restarting my computer
- Re-enabling USB debugging
- Revoking and authorizing my computer from USB debugging
- Re-enabling developer mode
adb shell pm list package ${packageName}
didn’t show it in the list so there was nothing to clean through there
Permanent fix
adb uninstall ${packageName}
and it showed ‘Success’. Now subsequent flutter runs work perfectly.
Possible cause
It seems uninstalling apps from the home screen does leave some intent or activities in some cache somewhere.