Can anybody tell me how I can install different builds for different flavors on one device without getting a "duplicate provider" error message neither in PlayStore nor in AndroidStudio?
I have different flavors for different countries in my app and it's annoying to always uninstall the app before installing another one.
I tried:
productFlavors {
austria {
manifestPlaceholders = [
// prevent "duplicate provider authority" message
providerAuthority: "com.example.app.at",
]
}
germany {
manifestPlaceholders = [
// prevent "duplicate provider authority" message
providerAuthority: "com.example.app.de",
]
}
//...
}
and in my AndroidManifest I added:
android:authorities="${providerAuthority}"
to my
<application/>
tag. This doesn't solve my problem.
I don't use a ContentProvider so I also tried adding a Stub ContentProvider class to the project and declared android:authorities="${providerAuthority}" inside the
<provider/>
tag including the name of the Stub ContentProvider --> no success. I would be very happy about some other ideas or corrections.
UPDATE:
the error message I get from Android Studio when trying to install the app on my device.

ContentProvider, where did you add this attribute? You might consider posting the entire stack trace of the installation exception, which should be showing up in LogCat. - CommonsWare