I would like to copy my Android project and create a new project from the same files just with a different name. The purpose of this is so I can have a second version of my
When you copy your project you will also need to delete the original remnant intermediate build (someActivity$4.class) files from the C:...\AndroidStudioProjects(project_name)\app\build\intermediates\classes\release... directories. Otherwise you will almost certainly have build failures for the new project if yo attempt to compile the copied project. Refactoring won't solve this.
Perhaps this will help someone.
For Android Studio 4.x Projects, you need following steps:
rootProject.name='newProjectName'
.Requirement and test on Android Studio 3.5
Make sure your old project working properly with your existing android studio library.
Note: if adb run showing activity not found, edit your Run/Debug Configuration. Module should point to module application e.g. app.
I had problems with this following:
https://google-developer-training.github.io/android-developer-fundamentals-course-concepts-v2/appendix/appendix-utilities/appendix-utilities.html
on Android Studio version: 3.3.2
until I killed the .idea/workspace.xml file.
$ cp -rv Testcopysource/ TestCopyDest
$ rm TestCopyDest/.idea/workspace.xml
$ stdio.sh & # Run Android Studio on Linux
Prior to doing that Android Studio would still point to the original source folder and all renames were applied to the original source files (within Testcopysource in my example above).
In Android Studio 4.0
you need only these few steps:
applicationId
inside app/build.gradle
com.domain.appname
to com.domain.newappname
highlight appname
)As of February 2020, for Android Studio 3.5.3, the simplest answer I found is this video.
Note 1: At 01.24 "Find" tab appears below. Click "Do Refactor" and continue as in the video.
Note 2: If you have any Java/Kotlin files "Marked as Plain Text" you need to modify the package name at the top manually, i.e. package com.example.thisplaceneedstobemanuallyupdated
Note 3: Be careful about letter cases while renaming, just as in the video.
Note 4: If you want to update the project name on title bar of project window, modify rootProject.name = 'YourProjectName'
inside "settings.gradle" file under "Gradle Scripts" directory.