Подтвердить что ты не робот

Файл класса для com.google.android.gms.internal.zzaja не найден

Я использую Fragment для проектирования простой регистрации входа в Firebase.

Я получаю ошибку в методе OnCreateView() при инициализации

auth = FirebaseAuth.getInstance();

Ошибка: - Ошибка: (58, 28) ошибка: не удается получить доступ к zzaja файл класса для com.google.android.gms.internal.zzaja не найден пожалуйста помоги источник: - http://www.androidhive.info/2016/06/android-getting-started-firebase-simple-login-registration-auth/

4b9b3361

Ответ 1

Я решил эту точную проблему сегодня и случайно наткнулся на этот неотвеченный вопрос во время процесса.

Во-первых, убедитесь, что вы правильно настроили Firebase для Android, как описано здесь: https://firebase.google.com/docs/android/setup. Затем убедитесь, что вы компилируете последнюю версию API Firebase (9.2.0) и API-интерфейсов Google Play (9.2.0), которые вы используете. Мои зависимости gradle выглядят примерно так:

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'
}

Надеюсь, это поможет!

Ответ 2

У меня была такая же ошибка, когда я недавно обновлял зависимость от игрового сервиса. Это похоже на то, когда вы не обновляете зависимости firebase, которые соответствуют используемой вами версии игровых сервисов. Я верю, что это последнее обновление этих зависимостей

Вот две версии моих зависимостей:

Ошибка версий зависимостей

compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.google.android.gms:play-services-places:10.0.1'
compile 'com.google.android.gms:play-services-location:10.0.1'
compile 'com.google.firebase:firebase-auth:9.8.0'
compile 'com.google.firebase:firebase-database:9.8.0'
compile 'com.firebaseui:firebase-ui-database:1.0.1'
compile 'com.google.firebase:firebase-storage:9.8.0'

Рабочая версия зависимостей ``

compile 'com.google.firebase:firebase-appindexing:10.0.1'
compile 'com.google.android.gms:play-services-maps:10.0.1'
compile 'com.google.android.gms:play-services-places:10.0.1'
compile 'com.google.android.gms:play-services-location:10.0.1'
compile 'com.google.firebase:firebase-auth:10.0.0'
compile 'com.google.firebase:firebase-database:10.0.0'
compile 'com.firebaseui:firebase-ui-database:1.0.1'
compile 'com.google.firebase:firebase-storage:10.0.0'

`` Google, похоже, в эти дни переносит обновления сервисных сервисов вместе с обновлениями firebase. Надеюсь, это спасет несколько душ.

Ответ 3

Если вы используете разные версии библиотек игровых сервисов, вы получите эту ошибку.

Например, ниже записи в файле build.gradle приводят к ошибке, поскольку версии отличаются.

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

Чтобы исправить проблему, используйте те же версии.

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

Ответ 4

Вся ваша версия firebase должна быть с той же версией, какой бы она ни была

как это

compile 'com.google.firebase:firebase-core:9.0.0'
compile 'com.google.firebase:firebase-database:9.0.0'
compile 'com.google.firebase:firebase-auth:9.0.0'
compile 'com.google.firebase:firebase-messaging:9.0.0' 

Ответ 5

Если вы используете несколько библиотек firebase, убедитесь, что версия одинакова.

Before:
  compile 'com.google.firebase:firebase-database:9.2.0'
    compile 'com.google.firebase:firebase-storage:9.2.0'
    compile 'com.firebaseui:firebase-ui-database:0.4.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.google.firebase:firebase-auth:9.0.2'

After:  compile 'com.google.firebase:firebase-database:9.2.0'
    compile 'com.google.firebase:firebase-storage:9.2.0'
    compile 'com.firebaseui:firebase-ui-database:0.4.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.google.firebase:firebase-auth:9.2.0'

в моем случае я использовал auth с 9.0.2. Итак, я изменил на 9.2.0

Ответ 6

Ну, краткий ответ: обновите версию своей библиотеки. Студия Android скажет вам, что есть новая версия с сообщением:

Доступна более новая версия com.google.firebase: ядро firebase, чем 14.0.4: 16.0.4

Просто перейдите к этой строке, нажмите Alt + Enter и выберите Изменить на XX, где XX - более новая версия.

Таким образом, вы можете обновить все свои библиотеки. Повторите процесс со всеми библиотеками, и все готово.

Ответ 7

Я решил проблему в июне 2017 года, изменив версии игровых сервисов для последних версий firebase (9.6.1). Когда я использовал последнюю версию игровых сервисов (10.2.4), я получил эту ошибку. Код в gradle выглядит следующим образом:

Перед

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'

После

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'

Ответ 8

У меня также та же проблема. Измените старую версию FirebaseAuth на более новую версию. для меня я изменяю "com.google.firebase:firebase-auth:11.4.0" на "com.google.firebase:firebase-auth:11.8.0"

Ответ 9

Как указано в документации Google, добавьте самую последнюю версию плагина Google Service (4.0.1 от 06/04/18). Надеюсь, что это hepls!

buildscript {
    // ...
    dependencies {
        // ...
        classpath 'com.google.gms:google-services:4.0.1' // google-services plugin
    }
}
'

Ответ 10

Play Services, Firebase, последняя версия комбинации Gradle плагин, который работал для меня.
попробуйте модуль приложения 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'

И уровень проекта build.gradle, как это

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'
    }
}

Ответ 11

Не смешивайте 12 и 15, используйте это

implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.0.0'

Ответ 12

Просто добавьте эти две зависимости в ваш pubspec.yml. это работает для меня.


firebase_messaging: ^ 5.0.1 firebase_core: ^ 0.3.0

Ответ 13

Применение:

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

Это работает.

Ответ 14

Вы можете легко решить эту проблему, получив последнюю версию Firebase Libraries для Android SDK.

Вы можете получить последнюю версию библиотеки по адресу https://firebase.google.com/docs/android/setup.

Пример:

До:

implementation 'com.google.firebase:firebase-auth:10.6.0'

в

После:

implementation 'com.google.firebase:firebase-auth:16.0.4'

Ответ 15

Просто убедитесь, что все реализации Firebase, которые вы используете, имеют одинаковую версию внутри зависимостей в build.gradle (приложение).

Ответ 16

Та же проблема произошла со мной. Обновив библиотеку до последней версии, вы решите эту проблему.

После обновления не забудьте сделать проект Sync с файлами Gradle.