Here are some techniques which you can use to remove this error:
-
Clean your project, Buidl->clean Project
-
Rebuild project, Build -> Rebuild Project
-
Open manifest and check is there any resource missing
-
Check-in layout to particular id if missing add it
-
If the above steps did not work then restart android studio with invalidating the cache
Also, ensure that your android_library/android_binary is using an AndroidManifest.xml with the correct package= attribute, and if you’re using the custom_package attribute on android_library or android_binary, ensure that it is spelt out correctly.
Also, make sure you have added correct package name on top of your java class.