Bug 1476271 - Perma Could not find com.google.android.gms:play-services-analytics:15.0.1; r?sdaswani draft
authorPetru Lingurar <petru.lingurar@softvision.ro>
Wed, 01 Aug 2018 18:28:13 +0300
changeset 825362 392c1a9922296c71c9f247a9a1bfc22904c8c803
parent 825337 e9dfe6306a214daa75b9025763b79a2fa2b2539a
push id118084
push userplingurar@mozilla.com
push dateWed, 01 Aug 2018 15:33:37 +0000
reviewerssdaswani
bugs1476271
milestone63.0a1
Bug 1476271 - Perma Could not find com.google.android.gms:play-services-analytics:15.0.1; r?sdaswani There is no 15.0.1 version of play-services-analytics. But there is a 15.0.2 version released in the same day as 15.0.1 for others so we'll use that until we can consolidate again all play-services to use the same version. Removed the workaround to force using the same gms version as it was already not needed anymore. MozReview-Commit-ID: C5iQrvXZNJt
build.gradle
mobile/android/app/build.gradle
--- a/build.gradle
+++ b/build.gradle
@@ -50,16 +50,20 @@ buildscript {
         }
     }
 
     ext.kotlin_version = '1.2.41'
     ext.support_library_version = '26.1.0'
 
     if (gradle.mozconfig.substs.MOZ_ANDROID_GOOGLE_PLAY_SERVICES) {
         ext.google_play_services_version = '15.0.1'
+        // There is no 15.0.1 version of play-services-analytics
+        // But there is a 15.0.2 version released in the same day as 15.0.1 for others
+        // TODO reunite the versions
+        ext.google_play_services_analytics_version = '15.0.2'
     }
 
     dependencies {
         classpath 'com.android.tools.build:gradle:3.1.0'
         classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2'
         classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
     }
 }
--- a/mobile/android/app/build.gradle
+++ b/mobile/android/app/build.gradle
@@ -232,17 +232,17 @@ dependencies {
     if (mozconfig.substs.MOZ_NATIVE_DEVICES) {
         implementation "com.android.support:mediarouter-v7:$support_library_version"
         implementation "com.google.android.gms:play-services-basement:$google_play_services_version"
         implementation "com.google.android.gms:play-services-base:$google_play_services_version"
         implementation "com.google.android.gms:play-services-cast:$google_play_services_version"
     }
 
     if (mozconfig.substs.MOZ_INSTALL_TRACKING) {
-        implementation "com.google.android.gms:play-services-analytics:$google_play_services_version"
+        implementation "com.google.android.gms:play-services-analytics:$google_play_services_analytics_version"
         implementation "com.google.android.gms:play-services-basement:$google_play_services_version"
     }
 
     if (mozconfig.substs.MOZ_ANDROID_GCM) {
         implementation "com.google.android.gms:play-services-basement:$google_play_services_version"
         implementation "com.google.android.gms:play-services-base:$google_play_services_version"
         implementation "com.google.android.gms:play-services-gcm:$google_play_services_version"
     }
@@ -439,30 +439,16 @@ android.applicationVariants.all configur
 
 
 // Bug 1320310 - Hack up the manifest produced by Gradle to match that produced
 // by moz.build.  Per https://bugzilla.mozilla.org/show_bug.cgi?id=1320310#c14,
 // this breaks launching in Android Studio; therefore, we only do this for
 // official automation builds and not for local developer builds.
 import groovy.xml.XmlUtil
 
-// Workaround for fixing sub-dependencies upon gradle error:
-// All gms/firebase libraries must use the exact same version specification (mixing versions can
-// lead to runtime crashes). Found versions 15.0.1, 15.0.0. Examples include
-// com.google.android.gms:play-services-base:15.0.1 and com.google.android.gms:play-services-cast:15.0.0
-configurations.all {
-    resolutionStrategy {
-        eachDependency { DependencyResolveDetails details ->
-            if (details.requested.group == 'com.google.android.gms') {
-                details.useVersion "$google_play_services_version"
-            }
-        }
-    }
-}
-
 android.applicationVariants.all { variant ->
     // Like 'local', 'localOld', or 'official'.
     def audienceDimension = variant.productFlavors[0].name
     if (!audienceDimension.equals('official')) {
         return
     }
 
     variant.outputs.each { output ->