Class file for com.google.android.gms.internal.zzaja not found

后端 未结 17 1696
北海茫月
北海茫月 2020-12-03 06:34

I am using Fragment for the designing of the Firebase simple login registration.

I get error in the OnCreateView() method on initializing



        
相关标签:
17条回答
  • 2020-12-03 06:46

    As stated in the Google documentation, Add the latest version of the Google Service plugin (4.0.1 on 06/04/18). Hope this hepls!

    buildscript {
        // ...
        dependencies {
            // ...
            classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
        }
    }
    `
    
    0 讨论(0)
  • 2020-12-03 06:48

    I solved the problem in june of 2017 changing the play-services versions for the latest firebase versions (9.6.1). When I used the latest play-services version (10.2.4) I got that error. The code in the gradle looks like this:

    Before

    compile 'com.google.android.gms:play-services-maps:10.2.4'
    compile 'com.google.android.gms:play-services-places:10.2.4'
    compile 'com.google.firebase:firebase-core:9.6.1'
    compile 'com.google.firebase:firebase-auth:9.6.1'
    

    After

    compile 'com.google.android.gms:play-services-maps:9.6.1'
    compile 'com.google.android.gms:play-services-places:9.6.1'
    compile 'com.google.firebase:firebase-core:9.6.1'
    compile 'com.google.firebase:firebase-auth:9.6.1'
    
    0 讨论(0)
  • 2020-12-03 06:50

    Use:

    compile 'com.google.firebase:firebase-auth:11.0.4'
    

    This works.

    0 讨论(0)
  • 2020-12-03 06:53

    I solved this exact problem today and stumbled onto this unanswered question by chance during the process.

    First, ensure you've properly setup Firebase for Android as documented here: https://firebase.google.com/docs/android/setup. Then, make sure you are compiling the latest version of the Firebase APIs (9.2.0) and the Google Play Services APIs (9.2.0) that you are using. My gradle dependencies look something like this:

    dependencies {
        ...
        compile 'com.google.android.gms:play-services-location:9.2.0'
        compile 'com.google.firebase:firebase-core:9.2.0'
        compile 'com.google.firebase:firebase-auth:9.2.0'
        compile 'com.google.firebase:firebase-messaging:9.2.0'
    }
    

    Hope this helps!

    0 讨论(0)
  • 2020-12-03 06:54

    play services, firebase, gradle plugin latest version combination that worked for me.
    try app module build.gradle

    android {
            compileSdkVersion 27
            buildToolsVersion '27.0.3'
            defaultConfig {
                applicationId "my package name"
                minSdkVersion 16
                targetSdkVersion 27
                versionCode 1
                versionName "1.0"
                multiDexEnabled true
                publishNonDefault true
                testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
            } }
    
        dependencies {
            implementation 'com.google.android.gms:play-services-location:15.0.1'
            implementation 'com.google.android.gms:play-services-maps:15.0.1'
            implementation 'com.google.android.gms:play-services-vision:15.0.2'
            implementation 'com.google.android.gms:play-services-analytics:16.0.1'
            implementation 'com.google.firebase:firebase-core:16.0.1'
            implementation 'com.google.firebase:firebase-iid:17.0.0'
            implementation 'com.google.firebase:firebase-messaging:17.3.0'
            implementation 'com.google.firebase:firebase-crash:16.0.1'
        }
    
        apply plugin: 'com.google.gms.google-services'
    

    And project level build.gradle like this

    buildscript {
        repositories {
    
            maven { url 'https://maven.google.com' }
            google()
            jcenter()
    
        }
    
        dependencies {
            classpath 'com.android.tools.build:gradle:3.1.4'
            classpath 'com.google.gms:google-services:4.1.0'
        }
    }
    
    0 讨论(0)
  • 2020-12-03 06:55

    If you use different version of play services libraries, you will get this error.

    For example, below entries in build.gradle file cause the error as versions are different.

    implementation 'com.google.android.gms:play-services-maps:11.4.2'
    implementation 'com.google.android.gms:play-services-location:11.6.0'
    

    To fix the issue use same versions.

    implementation 'com.google.android.gms:play-services-maps:11.6.0'
    implementation 'com.google.android.gms:play-services-location:11.6.0'
    
    0 讨论(0)
提交回复
热议问题