无法解决以下问题:位于com.google.firebase.storage.FirebaseStorage.getInstance的Lcom / google / android / gms / common / internal / zzbq;(未知来源)

时间:2018-09-30 23:19:05

标签: java android

此错误导致应用崩溃

  

java.lang.NoClassDefFoundError:无法解决以下问题:   Lcom / google / android / gms / common / internal / zzbq;           在com.google.firebase.storage.FirebaseStorage.getInstance(未知   资源)           在com.example.haji.UploadWallpaper.onCreate(UploadWallpaper.java:60)           在android.app.Activity.performCreate(Activity.java:6906)           在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)           在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2850)           在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2962)           在android.app.ActivityThread.-wrap12(ActivityThread.java)           在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1684)           在android.os.Handler.dispatchMessage(Handler.java:110)           在android.os.Looper.loop(Looper.java:232)           在android.app.ActivityThread.main(ActivityThread.java:6661)           在java.lang.reflect.Method.invoke(本机方法)           在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1106)           在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)        原因:java.lang.ClassNotFoundException:在路径上找不到类“ com.google.android.gms.common.internal.zzbq”。   DexPathList [[zip文件   “ /data/app/com.example.haji-1/base.apk"],nativeLibraryDirectories=[/data/app/com.example.haji-1/lib/arm64,   / system / lib64,/ vendor / lib64]]           在dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)           在java.lang.ClassLoader.loadClass(ClassLoader.java:380)           在java.lang.ClassLoader.loadClass(ClassLoader.java:312)           在com.google.firebase.storage.FirebaseStorage.getInstance(未知   资源)           在com.example.haji.UploadWallpaper.onCreate(UploadWallpaper.java:60)           在android.app.Activity.performCreate(Activity.java:6906)           在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)           在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2850)           在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2962)           在android.app.ActivityThread.-wrap12(ActivityThread.java)           在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1684)           在android.os.Handler.dispatchMessage(Handler.java:110)           在android.os.Looper.loop(Looper.java:232)           在android.app.ActivityThread.main(ActivityThread.java:6661)           在java.lang.reflect.Method.invoke(本机方法)           在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:1106)           在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)

这是我的构建包

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 个答案:

答案 0 :(得分:0)

我有类似的问题,尝试了很多事情。我建议可以解决您的问题的两件事。 1.尝试将其添加到项目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
    }

如果这不能解决问题,则: 2.然后在您的gradle中,我可以看到Firebase版本有所不同。尝试实施保存版本enter code here