I'm using Android Studio 3.4 and I would like to copy and rename (clone) one of my existing projects and reuse it under a different project name.
I have tried changing the package name and refactor it, but I'm somehow stuck.
Do I need to manually modify the Gradle files?
Do I need to manually modify the AndroidManifest.xml file?
A step-by-step guide would be really appreciated.
Select your project then go to Refactor -> Copy... . Android Studio will ask you the new name and where you want to copy the project. Provide the same. After the copying is done, open your new project in Android Studio.
Select Project Details under the project's thumbnail. Select the More menu. Select Duplicate.
You can follow this steps:
Check the file and sync the project with the Gradle file:
Make sure that the app and package names are correct in the AndroidManifest.xml file:
I had same question and the @bart answer helped me a lot. Nevertheless, after doing all said above, i received an error:
"Unsupported Modules Detected: Compilation is not supported for the following modules: (previousname)App. Unfortunately, you can't have non-Gradle Java modules and Android-Gradle modules in one project."
Looking around, I found this question.
So I resolved by doing what @D_Alpha suggested:
1- close the project
2- close Android Studio IDE
3- delete the .idea directory
4- delete all .iml files
5- open Android Studio IDE and import the project
The answer is taken from HERE
(version Android Studio: v.4.0)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With