[Android] Application crashing when using google-play-service:10.2.6

Upon loading the application I get the following runtime error

06-16 13:18:07.233 4595-4595/? E/AndroidRuntime: FATAL EXCEPTION: main
                                                 Process: com.myapp, PID: 4595
                                                 java.lang.NoSuchMethodError: No static method zzb(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; in class Lcom/google/android/gms/common/internal/zzac; or its super classes (declaration of 'com.google.android.gms.common.internal.zzac' appears in /data/data/com.myapp/files/instant-run/dex/slice-com.google.android.gms-play-services-base-11.0.1_42412c298ace10eded0d53c5e206fa3035d8c1d6-classes.dex)
                                                     at com.google.firebase.provider.FirebaseInitProvider.zza(Unknown Source)
                                                     at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
                                                     at android.app.ActivityThread.installProvider(ActivityThread.java:5853)

my app.gradle looks like this:

    compile 'com.google.android.gms:play-services:10.2.6'
    compile 'com.google.android.gms:play-services-gcm:10.2.6'
    compile 'com.google.firebase:firebase-core:10.2.6'

I’ve tried setting all versions to 11.0.1 but I get

Service connection failed: ConnectionResult{statusCode=SERVICE_VERSION_UPDATE_REQUIRED, resolution=null, message=null}

When sending analytics events at runtime.

Has anyone else run into this issue?

Author: Fantashit

1 thought on “[Android] Application crashing when using google-play-service:10.2.6

  1. Also, ran into this issue, fixed it by adding this to android/app/build.gradle

        compile 'com.android.support:appcompat-v7:25.4.0'
        compile 'com.android.support:support-v4:25.4.0'
        compile 'com.facebook.react:react-native:+'
        // From node_modules
        compile 'com.google.android.gms:play-services-gcm:11.0.1'
        compile 'com.google.android.gms:play-services-base:11.0.1'
        compile 'com.google.android.gms:play-services-analytics:11.0.1'
        compile 'com.google.firebase:firebase-core:11.0.1'
        compile 'com.google.firebase:firebase-config:11.0.1'
        compile 'com.google.firebase:firebase-auth:11.0.1'
        compile 'com.google.firebase:firebase-database:11.0.1'
        compile 'com.google.firebase:firebase-storage:11.0.1'
        compile 'com.google.firebase:firebase-messaging:11.0.1'
        compile 'com.google.firebase:firebase-crash:11.0.1'

    and in android/build.gradle

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
        repositories {
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.3.2'
            classpath 'com.google.gms:google-services:3.1.0'
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            mavenLocal()
            jcenter()
            maven {
                // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
                url "$rootDir/../node_modules/react-native/android"
            }
            maven {
                url "https://maven.google.com"
            }
        }
    }
    
    subprojects {
        ext {
            compileSdk = 25
            buildTools = "25.0.3"
            minSdk = 19
            targetSdk = 25
        }
    
        afterEvaluate { project ->
            if (!project.name.equalsIgnoreCase("app")
                    && project.hasProperty("android")) {
                android {
                    compileSdkVersion compileSdk
                    buildToolsVersion buildTools
                    defaultConfig {
                        minSdkVersion minSdk
                        targetSdkVersion targetSdk
                    }
                }
            }
        }
    }

    Make sure Google Play Services is up to date on the device you are testing.

Comments are closed.