I would like to create a "pro" version of my Android app.
I have to slightly change the app name, and the package name, and so on.
I tried the refactor command (renaming com.appname.app into com.appname.pro.app) but I see that nothing changed.
How to achieve the real name refactoring?
Asked
Active
Viewed 135 times
0

Phantômaxx
- 37,901
- 21
- 84
- 115

P5music
- 3,197
- 2
- 32
- 81
-
Make sure you're renaming with subpackages. – lexicore Apr 09 '18 at 08:44
-
Check that answer : https://stackoverflow.com/questions/18276872/change-project-name-on-android-studio – Itoun Apr 09 '18 at 08:50
-
@lexicore I do not find this option – P5music Apr 09 '18 at 08:51
-
if the biggest difference between your "pro" and your other version is the naming of a package, why bother? – Stultuske Apr 09 '18 at 08:52
-
@Stultuske I'm going to make some change after I have a new project for the separate pro app – P5music Apr 09 '18 at 08:54
2 Answers
0
First, select the settings and then
Then uncheck compact empty middle package, then refractor (shift+F6) each package name and make sure it changes in manifest and all over and clean and rebuild the project Also, check this

Subin Babu
- 1,515
- 2
- 24
- 50
0
I assume you're using Gradle
as a build tool.
You should use productFlavors
to achieve this.
Here's how :
android {
productFlavors {
free {
applicationId "xyz.some.domain.free"
}
pro {
applicationId "xyz.some.domain.pro"
}
}
}
place the above code
inside your app
level build.gradle
file. To customise it more, read this.
You can then install pro/free version using Gradle
tasks.

Balraj
- 328
- 2
- 7