Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Solution for Android build failure issues

Christian Brevik edited this page Sep 13, 2018 · 5 revisions

If you are facing the following issues - #207, https://github.com/idehub/react-native-google-analytics-bridge/issues/238, gradle issue, Failed resolution of: Lcom/google/android/gms/internal/zzjb, Google Play Services Dependency Issues, DexArchiveMergerException unable to merge dex, android crash, unable-to-merge-dex-after-upgrading-android-studio-3-0.

Please do the following steps -

Update the following:

  • Android Studio - 3.1.1
  • classpath 'com.android.tools.build:gradle: - 3.1.1 (project/app/build)
  • classpath 'com.google.gms:google-services: - 3.1.1 (project/app/build)
  • distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip (at gradle-wrapper.properties)
  • compile 'com.android.support:appcompat-v7:27.0.3'

Add the following lines:

  • googlePlayServicesVersion=12.0.1 (at gradle.properties)

  • compile 'com.android.support:multidex:1.0.3' ( dependency at android/app/build )

  • compile 'com.google.android.gms:play-services-analytics:12.0.1' ( dependency at android/app/build )

  • compile 'com.google.firebase:firebase-messaging:12.0.1' ( dependency at android/app/build )

  • compile 'com.google.firebase:firebase-core:12.0.1' ( dependency at android/app/build )

  • add lines at project/android/build

     allprojects {
        repositories {
        //start here
        configurations.all {
     resolutionStrategy.eachDependency { DependencyResolveDetails details ->
       def requested = details.requested
           if (requested.group == 'com.google.android.gms') {
              details.useVersion '12.0.1'
           }
           if (requested.group == 'com.google.firebase') {
              details.useVersion '12.0.1'
             }
           }
         }
        //end
         jcenter()
           maven {
             url "https://maven.google.com"
           }
         }
     }