今天 调试安卓app的时候 突然发现设备装不上app了 提示
Activity class {xxx} does not exist
搜寻了一遍 尝试了很多方法 大概如下
404
I faced a similar problem after refactoring.
This is what i did to resolve this issue:
Cleaned the Project
Deleted the Build directory
Restarted Android Studio
Rebuild the Project
Run
And everything worked fine!
I think the key is to restart your IDE.
Hope this helps you or anyone else!
Edit:
If above steps doesn't work for you, then deleting gradle cache seems be a solution, as pointed out by @Yasitha.
Edit 2
As suggested by a couple of users in the comments below, sometimes the issue can be resolved by completely removing and reinstalling the app from your device.
Simply type adb uninstall <package> in terminal to completely remove app from device.
UPDATE for Android Studio 2.1 and up
When running Android Studio 2.1 and up you can also encounter this issue when you have the instant run option enabled in your preferences (is enabled by default).
To disable this option go to Preferences option in the Android Studio top menu and look for Instant Run so you can uncheck the first checkbox on that screen.
adb uninstall <package> in terminal to completely remove app from device. 其中这条尝试了后解决~