ȜAmer Elsayed
ȜAmer Elsayed

Reputation: 65

Make Android build variants with different package and application id

Dears I want to make every build variant with a separated package name and application id because i need to upload app to google play testing env but i can't becuase of it's have project same package for published app on store

Upvotes: 2

Views: 1991

Answers (2)

saeedata
saeedata

Reputation: 947

you don't need to change the package name, you can add a suffix to each variant like this in app/build.gradle:

    debug {
        ...
        applicationIdSuffix = ".debug"
    }
    anotherFlavor {
        ...
        applicationIdSuffix = ".another"
    }

or you can change the application id like this :

debug {
  applicationId "com.app.debug"
}

Upvotes: 4

Cuong Nguyen
Cuong Nguyen

Reputation: 1018

In app/build.gradle, you setup

productFlavors {
    dev {
        dimension 'api'
        applicationId "com.abc.dev"
        targetSdkVersion 29
    }
    production {
        dimension 'api'
        applicationId "com.abc"
        targetSdkVersion 29
    }
}

Refer: enter link description here

Upvotes: 1

Related Questions