0

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?

Phantômaxx
  • 37,352
  • 21
  • 80
  • 110
P5music
  • 3,002
  • 2
  • 29
  • 74

2 Answers2

0

First, select the settings icon 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,450
  • 2
  • 23
  • 49
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