Renaming package in Android Studio
android, android-studio, package, refactoring
Solution
The reason you are seeing the generated files with the old package name is because you only renamed the source code package. The generated files use the package name defined in the AndroidManifest.xml. If you change the package at the top of the manifest as well you will see the generated files use the new package. Make sure to clean the project and rebuild to see the changes.
Problem
I am trying to rename my Android Studio package as described in the first answer at: Android Studio Rename Package Trying to change org.springframework.android.showcase to org.springframework.android.showcase2 The refactoring seemly works fine, then I try delete the old package within /gen/org.springframework.android/showcase. This does occur but then it reappears (Within /gen/org.springframework.android/showcase) When compiling I get over a 100 errors all related to the R.java file references. Copying the R.java, Manifest.java from the original to the new does not work either. Studio simply deletes these but leaves the BuildConfig.java file. Is there an easier way because Studio just does not seem to want to play ball? Below is my Project structure in case it's helpful