5

I get the following error when trying to build my application:

error: cannot access zzbfm class file for com.google.android.gms.internal.zzbfm not found

Here is my build.gradle file code:

apply plugin: 'com.android.application'


android {
compileSdkVersion 27
buildToolsVersion '27.0.3'
defaultConfig {

    applicationId "myapplicationid"
    minSdkVersion 21
    targetSdkVersion 27
    multiDexEnabled true
    versionCode 12
    versionName "1.0.1"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    vectorDrawables.useSupportLibrary = true
}
signingConfigs {
    key {
        keyAlias 'anavasis'
        keyPassword 'anavasis'
             storeFile file('jks_file_path')
        storePassword 'anavasis'
    }
}
buildTypes {
    debug {
    }
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
sourceSets { main { res.srcDirs = ['src/main/res', 'src/main/res/anim'] } }
allprojects {
    repositories {
        maven { url "https://jitpack.io" }
    }
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
//compile 'com.google.maps.android:android-maps-utils:0.4+'

compile 'com.android.support:appcompat-v7:27.1.1'
compile 'com.google.android.gms:play-services:11.8.0'
compile 'io.ticofab.androidgpxparser:parser:0.2.0'
compile 'com.google.maps.android:android-maps-utils:0.4.+'
compile 'com.android.support:design:27.1.0'
compile 'com.android.support:support-v4:27.1.0'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-vector-drawable:27.1.1'
compile 'com.android.support:recyclerview-v7:27.1.0'
testCompile 'junit:junit:4.12'
compile 'com.google.code.gson:gson:2.8.0'
compile 'com.github.bumptech.glide:glide:3.6.0'
compile 'com.squareup.picasso:picasso:2.5.2'

compile 'com.android.support:cardview-v7:27.1.0'

compile 'com.google.code.gson:gson:2.4'
compile 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.android.support:multidex:1.0.3'

compile 'com.android.billingclient:billing:1.0'

compile 'com.google.firebase:firebase-core:16.0.1'
compile 'com.google.firebase:firebase-crash:16.0.1'
compile 'com.google.firebase:firebase-auth:16.0.1'


 }

I have checked the answer here https://stackoverflow.com/a/50732851/1465756 but I do not have multiple firebase versions.

If I delete the 3 rows of compile firebase the app is running with no problems BUT I guess I should have them in my build.gradle.

1 Answer 1

3

In the top level gradle file use the following:

classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.google.gms:google-services:4.0.2'

To be able to use the latest firebase verisons, also upgrade the Android Studio to version 3.1

If you're not using Android Studio 3.1 to develop your app, you will need to upgrade in order to get the correct version checking behavior within the IDE.

https://android-developers.googleblog.com/2018/05/announcing-new-sdk-versioning.html


Also update:

compile 'com.google.android.gms:play-services:11.8.0'

into this:

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

Note: Don't use the combined play-services target. It brings in dozens of libraries, bloating your application. Instead, specify only the specific Google Play services APIs your app uses.

https://developers.google.com/android/guides/setup

Check this also:

Android | Cannot add all Google libraries for version 15.0.1

11
  • I have the android studio 3.1.3 and in my project gradle I added the classpaths you suggested (also tried com.android.tools.build:gradle:3.1.3 as suggested by android studio) but nothing worked
    – arniotaki
    Jul 31, 2018 at 9:53
  • Why are u using compile thought and not implementation? Jul 31, 2018 at 9:58
  • What is the difference? I tried to turn compile to implementation but again it didn't work
    – arniotaki
    Jul 31, 2018 at 10:02
  • I was just wondering because it was deprecated in the new gradle developer.android.com/studio/build/… (nothing to do with firebase) Jul 31, 2018 at 10:05
  • check the update @arniotaki You need to also update the google services libraries, just saw that you are using that Jul 31, 2018 at 10:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.