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
- Optionally (Go to the files menu on android, click on "Invalidate Caches / Restart..." uninstall the app on your phone and try again)
And everything worked fine!
I think the key is to restart your IDE.
Edit 1:
If the above steps don t work for you, then deleting Gradle cache
seems to 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 the device.
Edit 3
As mentioned in Abhishek s Answer, one should also try deleting the app from your device in case multiple users are set up on your device.
Simply go to Mobile Settings > Apps > [Your App] > More > Uninstall App for All Users
Edit 4
As mentioned by Yassin Ajdi, executing the uninstallAll
Gradle task can also fix the issue.
You can go to Gradle > Tasks > Install > uninstallAll
to get the job done.
<UPDATE for Andersroom 2.1 and up
如果你在选择优良时(因缺省而得到),你也可以面对这一问题。
将这一选择移至<条码>(>参考条码>>选择,载于<条码>。 现行Run使你能够打破该屏幕上的第一个检查箱。
这对我来说都是如此。 最初由用户@yusufonder指出。 我发现这个问题,因为<代码>格勒布>安装的工作仍在进行。