简体   繁体   中英

java.lang.ClassNotFoundException: Didn't find class “com.google.android.gms.dynamic.zzf” on path: DexPathList

I'm getting this strange error

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.dynamic.zzf" on path: DexPathList[[zip file "/data/app/com.dancam.chords-2/base.apk"],nativeLibraryDirectories=[/data/app/com.dancam.chords-2/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.android.gms.internal.zzel.(Unknown Source) at com.google.android.gms.internal.zzel.(Unknown Source) at com.google.android.gms.internal.zzel.zzeU(Unknown Source) at com.google.android.gms.internal.zzfh.zza(Unknown Source) at com.google.android.gms.ads.MobileAds.initialize(Unknown Source) at com.google.android.gms.ads.MobileAds.initialize(Unknown Source) at dancam.com.chords.Drawer.onCreate(Drawer.java:105) at android.app.Activity.performCreate(Activity.java:6684) at android.app.Instrumentation.callActivityOnCreate( Instrumentation.java:1119) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2637) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2751) at android.app.ActivityThread.-wrap12(ActivityThread.java) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1496) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6186) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

at Drawer, line 105

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

It's the first time I see this error and searching on Google I couldn't even find people talking about it.

Does any of you know why this happens and how to fix it?

MORE INFO:

After implemented the library I had to modify my build.gradle and add

defaultConfig {
 ...
 multiDexEnabled true
}

dataBinding {
 enabled = true
}

can this changes have something to do with the error?

I managed to fix this. I implemented firebase in my app like this

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'

the mismatch of version among this dependencies caused the app to crash. changing the last dependency to

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

fixed my problem.

the issue is occurring because google-play-services.jar is not located on path. is you added already and add jar into class path or proper location of jar file path. and if you are not use this then download jar and add into class path. you can download from bellow link:

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

if you are use maven project you can use bellow dependency :

<dependency>
    <groupId>com.google.android</groupId>
    <artifactId>android</artifactId>
    <version>4.1.1.4</version>
    <scope>provided</scope>
</dependency>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM