0
votes

app crashes on this error

java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/gms/common/internal/zzbq; at com.google.firebase.storage.FirebaseStorage.getInstance(Unknown Source) at com.example.haji.UploadWallpaper.onCreate(UploadWallpaper.java:60) at android.app.Activity.performCreate(Activity.java:6906) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2850) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2962) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1684) at android.os.Handler.dispatchMessage(Handler.java:110) at android.os.Looper.loop(Looper.java:232) at android.app.ActivityThread.main(ActivityThread.java:6661) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1106) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967) Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.common.internal.zzbq" on path: DexPathList[[zip file "/data/app/com.example.haji-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.haji-1/lib/arm64, /system/lib64, /vendor/lib64]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:380) at java.lang.ClassLoader.loadClass(ClassLoader.java:312) at com.google.firebase.storage.FirebaseStorage.getInstance(Unknown Source)  at com.example.haji.UploadWallpaper.onCreate(UploadWallpaper.java:60)  at android.app.Activity.performCreate(Activity.java:6906)  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2850)  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2962)  at android.app.ActivityThread.-wrap12(ActivityThread.java)  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1684)  at android.os.Handler.dispatchMessage(Handler.java:110)  at android.os.Looper.loop(Looper.java:232)  at android.app.ActivityThread.main(ActivityThread.java:6661)  at java.lang.reflect.Method.invoke(Native Method)  at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1106)  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)

And here's my build gradle

implementation 'com.firebaseui:firebase-ui-database:3.3.1'
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.firebaseui:firebase-ui-auth:3.3.1'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.android.gms:play-services-auth:11.8.0'
1
Update your dependencies. firebase-ui-database is on 4.2.0, firebase-database is on 16.0.1, firebase-ui-auth is on 4.2.0, firebase-auth is on 16.0.3, firebase-storage is on 16.0.4, play-services-auth is on 16.0.0.TheWanderer

1 Answers

0
votes

I had similar issue and tried many things. I suggest two things which can solve your problem. 1. try adding this in your project build.gradle

buildscript {

    repositories {
        google()
        maven {url "https://maven.google.com"}
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.4'
        classpath 'com.google.gms:google-services:4.0.1'



        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
    }

    allprojects {
        repositories {
        google()
        maven {url "https://maven.google.com"}
        jcenter()
    }
    }

    task clean(type: Delete) {
        delete rootProject.buildDir
    }

if this doesn't solve problem then: 2. then in your gradle I can see Firebase versions are different. try implement save versionsenter code here