'Different versions of Google Play services cannot be declared depending on the device configuration
When trying to upload my application (aab) to the play store - Im seeing this error, and I cant find anyone talking about it. The error message is translated from Swedish -> English using Google Translate.
The versions used are 0, and 12451000. Its clear to me that the 0 is a mistake, but Ive now spent several days trying to figure out where the 0 is coming from without any success.
Things Ive tried;
- Export the aab using different versions of Android Studio. Ive tried stable, beta & canary.
- Reduce versions of my dependencies to the ones I know have worked in the past.
- Update dependencies, gradle, libraries, etc.
- Invalidate caches, reinstall Android Studio, wipe its settings and follow its 'repair IDE' wizard.
- Verify that build.gradle and plugins are written & used correctly.
My usage of the play services is quite broad, I apply them in my app/phone module with an additional line in my plugins block id 'com.google.gms.google-services'
. The root build.gradle contains the classpath to com.google.gms:google-services
.
My full related dependencies are as follows (declared in TOML);
firebase-gradle = { module = 'com.google.firebase:firebase-crashlytics-gradle', version = '2.8.1' }
firebase-bom = { module = 'com.google.firebase:firebase-bom', version = '29.3.0' }
firebase-crashlytics = { module = 'com.google.firebase:firebase-crashlytics-ktx' }
firebase-auth = { module = 'com.google.firebase:firebase-auth-ktx' }
firebase-database = { module = 'com.google.firebase:firebase-database-ktx' }
google-gradle = { module = 'com.google.gms:google-services', version.ref = 'google-services' }
google-auth = { module = 'com.google.android.gms:play-services-auth', version.ref = 'google-auth' }
google-fitness = { module = 'com.google.android.gms:play-services-fitness', version.ref = 'google-fitness' }
google-services = '4.3.10'
google-auth = '20.1.0'
google-fitness = '21.0.1'
At this point Im looking for any guidance I can get. Are there any additional troubleshooting steps I can take? Have you experienced something similar in the past? Please let me know.
Solution 1:[1]
This could be a versioning problem. Try changing the
com.android.application and com.android.library
versions from 7.3.0-alpha 07
to 7.1.2.
Alternatively, try the remedy below
androidComponents {
onVariants(selector().all(), {
def capitalizedVariantName = name.substring(0,1).toUpperCase() + name.substring(1)
afterEvaluate {
tasks.named("map${capitalizedVariantName}SourceSetPaths").configure {
it.dependsOn("process${capitalizedVariantName}GoogleServices")
}
}
}) }
The issue has been fixed and closed. Check it here on Issue Tracker The work around could be unnecessary.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |