Не удается получить доступ к файлу класса zzbfm для com.google.android.gms.internal.zzbfm не найден - PullRequest
0 голосов
/ 10 сентября 2018

Я переносю проект моего приложения для Android с GCM на FCM. Для этого я использую помощник Firebase в Android Studio и следовал инструкциям из руководства разработчика Google. Все прошло нормально и изменил код моего приложения на FCM в соответствии с инструментом Assistant. Теперь пришло время запустить и протестировать приложение. И я получил следующую странную ошибку:

не может получить доступ к файлу класса zzbfm для com.google.android.gms.internal.zzbfm не найден

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

buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
    mavenCentral()
    maven { url 'https://dl.bintray.com/kennyc1012/maven' }
}


android {
    signingConfigs {
        msapp {
        }
    }

    compileSdkVersion 26
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "com.package"
        minSdkVersion 16
        targetSdkVersion 28
        multiDexEnabled true
        useLibrary 'org.apache.http.legacy'
        compileOptions {
            sourceCompatibility JavaVersion.VERSION_1_7
            targetCompatibility JavaVersion.VERSION_1_7
        }
        renderscriptTargetApi 18
        renderscriptSupportModeEnabled true
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
    buildTypes {

        release {
            lintOptions {
                checkReleaseBuilds false
                abortOnError false
            }
            minifyEnabled false
            shrinkResources false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    //Default
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.google.firebase:firebase-messaging:11.8.0'
    testImplementation 'junit:junit:4.12'

    //modules
    implementation 'com.facebook.android:facebook-android-sdk:4.+'
    //jar files
    implementation files('libs/classes.jar')
    implementation files('libs/YouTubeAndroidPlayerApi.jar')

    //google repos
    implementation 'com.android.support:appcompat-v7:26.0.0'
    implementation 'com.android.support:support-v4:26.0.0'
    implementation 'com.android.support:recyclerview-v7:26.0.0'
    implementation 'com.google.android.gms:play-services:11.8.0'
    implementation 'com.google.android.gms:play-services-analytics:11.8.0'
    implementation 'com.google.android.gms:play-services-maps:11.8.0'
    implementation 'com.android.support:design:26.0.0'


    //square lib
    implementation 'com.squareup.retrofit2:converter-gson:2.0.0'
    //compile 'com.squareup.leakcanary:leakcanary-android:1.5'

    //text manupulation
    implementation 'commons-lang:commons-lang:2.6'

    //permission library.
    implementation 'com.karumi:dexter:5.0.0'

    implementation 'com.google.firebase:firebase-core:16.0.3'
}

apply plugin: 'com.google.gms.google-services'

Ответы [ 4 ]

0 голосов
/ 13 августа 2019

В большинстве случаев требуется обновить зависимости play-services и версии firebase, возможно, последняя из доступных, если вы используете androidx , но если нет:

Попробуйте проверить это maven_repository и выберите версию, которая поможет вам исправить это.Например:

implementation 'com.google.android.gms:play-services-analytics:16.0.8'
implementation 'com.google.android.gms:play-services-maps:16.1.0'
implementation 'com.google.firebase:firebase-messaging:15.0.2'

выбранная версия является последней перед версией 17, поскольку v17.0.0 требует androidx (в игровом сервисе)

Не забудьте обновить Google-сервис в вашем build.gradle (проект)

classpath 'com.google.gms:google-services:4.3.0'        
0 голосов
/ 10 сентября 2018
To resolve your problem, first i will ask you to always use specified and updated version.
1. Replace + with specific version here : classpath 'io.fabric.tools:gradle:1.25.4'
2. Try to use same version for now to run the apk,
compileSdkVersion 27
    buildToolsVersion '27.0.3'
        targetSdkVersion 27
implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:recyclerview-v7:27.1.1'

3. Use updated version of google play service

    implementation 'com.google.android.gms:play-services:16.0.3'
    implementation 'com.google.android.gms:play-services-analytics:16.0.3'
    implementation 'com.google.android.gms:play-services-maps:15.0.1'

This will fix your problem.
0 голосов
/ 10 сентября 2018

В соответствии с официальной документацией относительно Последние версии SDK , пожалуйста, измените следующую строку кода:

implementation 'com.google.firebase:firebase-messaging:11.8.0'

до

implementation 'com.google.firebase:firebase-messaging:17.3.1'

И в соответствии с официальной документацией по настройке Google Play Services , пожалуйста, измените следующие строки кода:

implementation 'com.google.android.gms:play-services:11.8.0'
implementation 'com.google.android.gms:play-services-analytics:11.8.0'
implementation 'com.google.android.gms:play-services-maps:11.8.0'

до

//implementation 'com.google.android.gms:play-services:11.8.0' //Commented line
implementation 'com.google.android.gms:play-services-analytics:16.0.3'
implementation 'com.google.android.gms:play-services-maps:15.0.1

Пожалуйста, не забудьте также:

classpath 'com.google.gms:google-services:4.1.0'

В вашем файле верхнего уровня build.gradle.

0 голосов
/ 10 сентября 2018

Пожалуйста, измените Firebase и Google Library на ту же версию. Для примера, подобного этому

      implementation 'com.google.android.gms:play-services:12.0.1'
      implementation 'com.google.android.gms:play-services-analytics:12.0.1'
      implementation 'com.google.android.gms:play-services-maps:12.0.1'
        //your firebase lib version to the same version 
      implementation 'com.google.firebase:firebase-core:12.0.1'
...