Android apps with same signature but different packages

1.1k Views Asked by At

I have android application with different builds:

  1. com.my.application.dev
  2. com.my.application.test
  3. com.my.application.release

but they are signed with same signature. When i try to install on device few builds simultaneously, i get error "package with this name already exist". Is it ok? Is this correct behavior?

2

There are 2 best solutions below

0
Sektor On BEST ANSWER

I found the cause of this problem. There was a problem with the content provider, builds had different packages but tried to add content providers with the same name

0
navylover On

You could use applicationIdSuffix which is:

Application id suffix. It is appended to the "base" application id when calculating the final application id for a variant.

For example:

android {
    ...
    defaultConfig {...}
    buildTypes {
        debug{...}
        release{...}
    }

    flavorDimensions "version"
    productFlavors {
        demo {
            dimension "version"
            applicationIdSuffix ".demo"
        }
        full {
            dimension "version"
            applicationIdSuffix ".full"
        }
    }
}