java.lang.ClassNotFoundException:在路径上找不到类“com.google.android.gms.dynamic.zzf”:DexPathList

时间:2017-07-18 17:54:18

标签: java android classnotfoundexception

我收到了这个奇怪的错误

  

引起:java.lang.ClassNotFoundException:在路径上找不到类“com.google.android.gms.dynamic.zzf”:DexPathList [[zip file“/data/app/com.dancam.chords- 2 / base.apk“],nativeLibraryDirectories = [/ data / app / com.dancam.chords-2 / lib / arm64,/ system / lib64,/ vendor / lib64]]                                                                          在dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)                                                                          at java.lang.ClassLoader.loadClass(ClassLoader.java:380)                                                                          在java.lang.ClassLoader.loadClass(ClassLoader.java:312)                                                                          在com.google.android.gms.internal.zzel。(未知来源)                                                                          在com.google.android.gms.internal.zzel。(未知来源)                                                                          在com.google.android.gms.internal.zzel.zzeU(未知来源)                                                                          在com.google.android.gms.internal.zzfh.zza(未知来源)                                                                          在com.google.android.gms.ads.MobileAds.initialize(未知来源)                                                                          在com.google.android.gms.ads.MobileAds.initialize(未知来源)                                                                          在dancam.com.chords.Drawer.onCreate(Drawer.java:105)                                                                          在android.app.Activity.performCreate(Activity.java:6684)                                                                          在android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1119)                                                                          在android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2637)                                                                          在android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2751)                                                                          在android.app.ActivityThread.-wrap12(ActivityThread.java)                                                                          在android.app.ActivityThread $ H.handleMessage(ActivityThread.java:1496)                                                                          在android.os.Handler.dispatchMessage(Handler.java:102)                                                                          在android.os.Looper.loop(Looper.java:154)                                                                          在android.app.ActivityThread.main(ActivityThread.java:6186)                                                                          at java.lang.reflect.Method.invoke(Native Method)                                                                          在com.android.internal.os.ZygoteInit $ MethodAndArgsCaller.run(ZygoteInit.java:889)                                                                          在com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

在抽屉,第105行

MobileAds.initialize(getApplicationContext(), "ca-app-pub-nnnnnnnnnnnnnnnnnnnnnnn");

这是我第一次看到这个错误并在Google上搜索我甚至找不到人们在谈论它。

你们有谁知道为什么会发生这种情况以及如何解决这个问题?

更多信息:

实施库后,我必须修改build.gradle并添加

defaultConfig {
 ...
 multiDexEnabled true
}

dataBinding {
 enabled = true
}

此更改是否与错误有关?

2 个答案:

答案 0 :(得分:2)

我设法解决了这个问题。我在我的应用程序中实现了firebase,就像这样

compile 'com.google.firebase:firebase-ads:10.2.0'
compile 'com.google.firebase:firebase-invites:10.2.0'
compile 'com.google.firebase:firebase-crash:10.2.0'
compile 'com.google.firebase:firebase-storage:11.0.2'

此依赖项之间的版本不匹配导致应用程序崩溃。将最后一个依赖项更改为

compile 'com.google.firebase:firebase-storage:10.2.0'

解决了我的问题。

答案 1 :(得分:0)

问题正在发生,因为get_field('employee_name')不在路径上。你是否已添加并将jar添加到类路径或jar文件路径的正确位置。如果你不使用它,那么下载jar并添加到类路径中。你可以从bellow链接下载:

http://www.java2s.com/Code/Jar/g/Downloadgoogleplayservicesjar.htm

如果您使用maven项目,则可以使用以下依赖项:

get_field('employee_name', $employee_id=100)