在路径上找不到“com.google.firebase.provider.FirebaseInitProvider”类

时间:2017-01-14 16:34:35

标签: java android firebase

在genymotion中运行app时。它显示对话框“不幸停止了”。我不懂logcat。你能告诉我发生了什么吗?

    01-14 11:16:55.561 3229-3229/? E/AndroidRuntime: FATAL EXCEPTION: main
    java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.example.mypc.map1-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.mypc.map1-1, /system/lib]]
    at android.app.ActivityThread.installProvider(ActivityThread.java:4882)
    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4485)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4425)
    at android.app.ActivityThread.access$1300(ActivityThread.java:141)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
    at android.os.Handler.dispatchMessage(Handler.java:99)
    at android.os.Looper.loop(Looper.java:137)
    at android.app.ActivityThread.main(ActivityThread.java:5103)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:525)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    at dalvik.system.NativeStart.main(Native Method)
    Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.firebase.provider.FirebaseInitProvider" on path: DexPathList[[zip file "/data/app/com.example.mypc.map1-1.apk"],nativeLibraryDirectories=[/data/app-lib/com.example.mypc.map1-1, /system/lib]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:53)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:501)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:461)
    at android.app.ActivityThread.installProvider(ActivityThread.java:4867)
    at android.app.ActivityThread.installContentProviders(ActivityThread.java:4485) 
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4425) 
    at android.app.ActivityThread.access$1300(ActivityThread.java:141) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316) 
    at android.os.Handler.dispatchMessage(Handler.java:99) 
    at android.os.Looper.loop(Looper.java:137) 
    at android.app.ActivityThread.main(ActivityThread.java:5103) 
    at java.lang.reflect.Method.invokeNative(Native Method) 
    at java.lang.reflect.Method.invoke(Method.java:525) 
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553) 
    at dalvik.system.NativeStart.main(Native Method) 

的build.gradle

enter image description here

1 个答案:

答案 0 :(得分:0)

创建应用程序类

manifest.xml

并将其添加到名称属性中的{{1}}。