使用Gradle构建的Firebase-demo / Analytics NoClassDefFoundError异常

时间:2018-09-02 08:41:27

标签: android unity3d firebase-analytics

当我在使用gradle构建的游戏中添加Firebase分析时,出现了NoClassDefFoundError异常,因此我在firebase(https://github.com/firebase/quickstart-unity)的此演示应用程序上尝试了该错误,但得到了相同的错误,但类不同。我所做的只是将构建设置更改为gradle,没有更改任何gradle配置。

我的统一版本是5.6.3f1。 我正在使用firebase_unity_sdk_5.2.1插件。

这是Google Analytics(分析)快速入门演示中的错误:

09-02 16:21:42.621 2968 2968 E AndroidRuntime:致命异常:main
09-02 16:21:42.621 2968 2968 E Android Runtime:进程:com.DefaultCompany.DefaultProject,PID:2968
09-02 16:21:42.621 2968 2968 E AndroidRuntime:java.lang.NoClassDefFoundError:无法解决以下问题:Lcom / google / android / gms / measurement / AppMeasurement;
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在com.google.firebase.analytics.connector.AnalyticsConnectorImpl.getInstance(未知来源:23)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在com.google.firebase.analytics.connector.internal.zzb.create(未知来源:8)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在com.google.firebase.components.zzh.zza(com.google.firebase:firebase-common @@ 16.0.1:29)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在com.google.firebase.components.zzi.get(未知来源:4)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在com.google.firebase.components.zzh.get(com.google.firebase:firebase-common @@ 16.0.1:40)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在com.google.firebase.components.ComponentContainer $$ CC.get(com.google.firebase:firebase-common @@ 16.0.1:15)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在com.google.firebase.components.zzd.get(未知来源:0)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在com.google.firebase.components.zzd.zza(com.google.firebase:firebase-common @@ 16.0.1:68)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在com.google.firebase.FirebaseApp.zze(com.google.firebase:firebase-common @@ 16.0.1:716)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common @@ 16.0.1:329)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common @@ 16.0.1:295)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common @@ 16.0.1:282)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在com.google.firebase.provider.FirebaseInitProvider.onCreate(com.google.firebase:firebase-common @@ 16.0.1:37)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:at android.content.ContentProvider.attachInfo(ContentProvider.java:1925)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:at android.content.ContentProvider.attachInfo(ContentProvider.java:1900)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common @@ 16.0.1:31)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在android.app.ActivityThread.installProvider(ActivityThread.java:6578)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在android.app.ActivityThread.installContentProviders(ActivityThread.java:6133)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在android.app.ActivityThread.handleBindApplication(ActivityThread.java:6043)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:位于android.app.ActivityThread.-wrap1(未知来源:0)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1764)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在android.os.Handler.dispatchMessage(Handler.java:105)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在android.os.Looper.loop(Looper.java:164)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在android.app.ActivityThread.main(ActivityThread.java:6944)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:at java.lang.reflect.Method.invoke(本机方法)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在com.android.internal.os.Zygote $ MethodAndArgsCaller.run(Zygote.java:327)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:由以下原因引起:java.lang.ClassNotFoundException:在路径:DexPathList [[zip file“ /下未找到类” com.google.android.gms.measurement.AppMeasurement“ data / app / com.DefaultCompany.DefaultProject-KmqojsTcbAmAFIe0mAe1NA == / base.apk“],nativeLibraryDirectories = [/ data / app / com.DefaultCompany.DefaultProject-KmqojsTcbAmAFIe0mAe1NA == / lib / arm,/data/app/com.DefaultCompany .DefaultProject-KmqojsTcbAmAFIe0mAe1NA == / base.apk!/ lib / armeabi-v7a,/ system / lib,/ system / vendor / lib]]
09-02 16:21:42.621 2968 2968 E AndroidRuntime:在dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
09-02 16:21:42.621 2968 2968 E AndroidRuntime:...还有27个

这是从我的游戏中获得的

09-02 15:12:24.259 29752 29752 E AndroidRuntime:致命异常:main
09-02 15:12:24.259 29752 29752 E AndroidRuntime:进程:com.DefaultCompany.DefaultProject,PID:29752
09-02 15:12:24.259 29752 29752 E AndroidRuntime:java.lang.NoClassDefFoundError:无法解决以下问题:Lcom / google / android / gms / common / internal / Preconditions;
09-02 15:12:24.259 29752 29752 E AndroidRuntime:位于com.google.firebase.provider.FirebaseInitProvider.attachInfo(com.google.firebase:firebase-common @@ 16.0.1:1050)
09-02 15:12:24.259 29752 29752 E AndroidRuntime:在android.app.ActivityThread.installProvider(ActivityThread.java:6578)
09-02 15:12:24.259 29752 29752 E AndroidRuntime:位于android.app.ActivityThread.installContentProviders(ActivityThread.java:6133)
09-02 15:12:24.259 29752 29752 E AndroidRuntime:位于android.app.ActivityThread.handleBindApplication(ActivityThread.java:6043)
09-02 15:12:24.259 29752 29752 E AndroidRuntime:位于android.app.ActivityThread.-wrap1(未知源:0)
09-02 15:12:24.259 29752 29752 E AndroidRuntime:在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1764)
09-02 15:12:24.259 29752 29752 E AndroidRuntime:位于android.os.Handler.dispatchMessage(Handler.java:105)
09-02 15:12:24.259 29752 29752 E AndroidRuntime:位于android.os.Looper.loop(Looper.java:164)
09-02 15:12:24.259 29752 29752 E AndroidRuntime:位于android.app.ActivityThread.main(ActivityThread.java:6944)
09-02 15:12:24.259 29752 29752 E AndroidRuntime:at java.lang.reflect.Method.invoke(本机方法)
09-02 15:12:24.259 29752 29752 E AndroidRuntime:在com.android.internal.os.Zygote $ MethodAndArgsCaller.run(Zygote.java:327)
09-02 15:12:24.259 29752 29752 E AndroidRuntime:在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
09-02 15:12:24.259 29752 29752 E AndroidRuntime:由以下原因引起:java.lang.ClassNotFoundException:在路径:DexPathList中找不到类“ com.google.android.gms.common.internal.Preconditions” [[zip文件] “ /data/app/com.DefaultCompany.DefaultProject-5mnEepmltZFu956Rz8DGDQ==/base.apk"],nativeLibraryDirectories=[/data/app/com.DefaultCompany.DefaultProject-5mnEepmltZFu956Rz8DGDQ==/lib/arm,/ data / app / com .DefaultCompany.DefaultProject-5mnEepmltZFu956Rz8DGDQ == / base.apk!/ lib / armeabi-v7a,/ system / lib,/ system / vendor / lib]]
09-02 15:12:24.259 29752 29752 E AndroidRuntime:在dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:93)
09-02 15:12:24.259 29752 29752 E AndroidRuntime:at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
09-02 15:12:24.259 29752 29752 E AndroidRuntime:at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
09-02 15:12:24.259 29752 29752 E AndroidRuntime:...还有12个

谢谢您的帮助!

0 个答案:

没有答案