简体   繁体   中英

Uninstalling my app from the device makes it so that I can no longer run it from Android Studio

I can deploy a fresh hello world app no problem (as long as it's not with the same name/namespace as one I've already uninstalled from the device). However, the moment that I uninstall the app (accidentally admittedly) I can no longer just run and I see this error in its place:

$ adb shell am start -n "com.ld.hello_android/com.ld.hello_android.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Error while executing: am start -n "com.ld.hello_android/com.ld.hello_android.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.ld.hello_android/.MainActivity }
Error type 3
Error: Activity class {com.ld.hello_android/com.ld.hello_android.MainActivity} does not exist.

Error while Launching activity

Any help would be most appreciated.

Seems that this issue is, for whatever reason, specific to my device (Pixel 3). Another device (same Pixel 3) as well as a Nexus 6P I keep around do not display this behavior. I managed to address this problem on my device by running the uninstallDebug gradle task before trying to run the app again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM