Today, we will share with you the solution for class “zzbfm” not found error while working on Firebase and Google maps.
If you are ever facing an error in android that says:
class file for com.google.android.gms.internal.zzbfm not found
It is most likely when you just integrated Firebase library in your project that is already using maps, location or places.
The solution to this is:
- Version number of google maps and Firebase should be same.
- Change “implementation fileTree” to “compileOnly fileTree”
- Enable multiDex and add multiDex library
app > build.gradle
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | android { compileSdkVersion 28 // buildToolsVersion "29.0.2" defaultConfig { applicationId "your.application.id" minSdkVersion 22 targetSdkVersion 28 versionCode 1 versionName "1.0" multiDexEnabled true // important testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile( 'proguard-android-optimize.txt' ), 'proguard-rules.pro' } } } dependencies { // implementation fileTree(include: ['*.jar'], dir: 'libs') compileOnly fileTree(dir: 'libs' , include: [ '*.jar' ]) implementation 'com.google.android.gms:play-services-maps:11.8.0' implementation 'com.google.android.gms:play-services-location:11.8.0' implementation 'com.google.android.gms:play-services-places:11.8.0' implementation 'com.google.firebase:firebase-core:11.8.0' implementation 'com.google.firebase:firebase-messaging:11.8.0' implementation 'com.google.firebase:firebase-database:11.8.0' implementation 'com.android.support:multidex:1.0.3' } apply plugin: 'com.google.gms.google-services' |
build.gradle
1 2 3 4 5 6 7 8 9 10 | buildscript { repositories { jcenter() google() } dependencies { classpath 'com.android.tools.build:gradle:3.1.2' classpath 'com.google.gms:google-services:4.0.1' } } |
If your problem persists, please mention it in the comments section below. Check Google cloud platform for more services.
Learn how to embed maps without API key.