If you use Google Play Services you can create a issue where your app will not be installable because of the app conflicting with any other app the GPS was installed that might not have a defaultConfig.applicationId. Android Studio by defaults creates this to eliminate the issue, but we also need to as the issue will prevent ANY two apps by ALL developers that don't have this set to be installable on the same device.
The solution is in the App_Resources/Android/app.gradle to add the (--> line):
defaultConfig {
generatedDensities = []
--> applicationId = "my.package.id"
}
Or we can do this in the main build.gradle file and somehow pull the value from the main package.json file..
Links:
https://code.google.com/p/analytics-issues/issues/detail?id=784
https://code.google.com/p/android/issues/detail?id=193567
http://stackoverflow.com/questions/16267785/install-shows-error-in-console-install-failed-conflicting-provider
Hi @NathanaelA,
We try to stay as close to a default android studio project, and the case you suggest is an excellent spot, that will save us trouble in the future. Because CLI already has logic for filtering the app-name and package, we can reuse it to replace a placeholder in App_Resources/Android/app.gradle.
I would like to add that this issue has already happened to me with an NS app. I created the following SO question for this:
http://stackoverflow.com/questions/37260735/issue-running-more-than-one-nativescript-application-on-the-same-android-device
Changes are in the nativescript-cli/master - Add interpolation for app.gradle applicationId value in android projects
Most helpful comment
Hi @NathanaelA,
We try to stay as close to a default android studio project, and the case you suggest is an excellent spot, that will save us trouble in the future. Because CLI already has logic for filtering the app-name and package, we can reuse it to replace a placeholder in
App_Resources/Android/app.gradle.