I am starting to develop on Android and during the creation of the project everything was going well, when I import the R class in the Activity the import path is as follows:
import com.example.corporation.bible_ebate.R
In the progress of the project I decided to get rid of the name that I gave to the initial package, for which I made a Refactor and now this:
corporation.bibledebate
So now I want R to be imported as:
import corporation.bibledebate.R
And not as it was before, but it doesn't work, it keeps importing with the old name, do Clean, Rebuild , Restart , however I can't do what to do to change the import path, any ideas would be appreciated.
Regardless of how you refactored the application package, you have to ensure mainly 3 things for your project to work properly:
1) Inside the file
AndroidManifest.xml
the package should be the one you changed2) Inside your file
build.gradle
your applicationid should be the package name:3) Check that in some layout you do not have the previous package name defined: "
com.example.corporation.bible_ebate
" , for example in Custom Views.Remember that the red R's regularly indicate a problem in the resources, in this case the layout that one of them may have the wrong package name defined:
Android, red "R's" throughout the code