"Cannot find symbol R" error after renaming package name

Try to change application Id in build.gradle. Or remove any imports of com.***.R in your activity and let android studio to automatically import for you.


Try the following :

Try deleting your R.java file , android studio will regenerate it.

Clean Project

Rebuild Project

And check:

Check the AndroidManifest.xml, there's a package attribute on the top-level element

(Well it depends on how you renamed your package name)


Just do the following:

Ensure that the package name at the header of the AndroidManifest file has been renamed to your new package name. This worked for me.

Tags:

Android