How do you rename packages in the new IDE Android Studio, based on IntelliJ IDEA?
Is there an automatic refactoring included?
I want to make bulk refactorin
The first part consists of creating a new package under java
folder and selecting then dragging all your source files from the old package
to this new package
. After that you need to remane
the package name in android manifest
to the name of the new package.
In step 2, here is what you need to do.You need to change the old package name in applicationId
under the module build.gradle
in your android studio in addition to changing the package name in the manifest
. So in summary, click on build.gradle
which is below the "AndroidManifest.xml" and modify the value of applicationId
to your new package name.
Then, at the very top, under build
. clean
your project, then rebuild
. It should be fine from here.