Process: com.example.button, PID: 21229
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider;
at com.bumptech.glide.Glide.<init>(Glide.java:386)
at com.bumptech.glide.GlideBuilder.build(GlideBuilder.java:564)
at com.bumptech.glide.Glide.initializeGlide(Glide.java:290)
at com.bumptech.glide.Glide.initializeGlide(Glide.java:242)
at com.bumptech.glide.Glide.checkAndInitializeGlide(Glide.java:201)
at com.bumptech.glide.Glide.get(Glide.java:182)
at com.bumptech.glide.Glide.getRetriever(Glide.java:749)
at com.bumptech.glide.Glide.with(Glide.java:801)
at com.example.button.ImageViewActivity.onCreate(ImageViewActivity.java:16)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.bumptech.glide.gifdecoder.GifDecoder$BitmapProvider" on path: DexPathList[[zip file "/data/app/com.example.button-naQ3ec-qhWEEcVpQUHVEbw==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.button-naQ3ec-qhWEEcVpQUHVEbw==/lib/x86, /system/lib, /system/product/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:196)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at com.bumptech.glide.Glide.<init>(Glide.java:386)
at com.bumptech.glide.GlideBuilder.build(GlideBuilder.java:564)
at com.bumptech.glide.Glide.initializeGlide(Glide.java:290)
at com.bumptech.glide.Glide.initializeGlide(Glide.java:242)
at com.bumptech.glide.Glide.checkAndInitializeGlide(Glide.java:201)
at com.bumptech.glide.Glide.get(Glide.java:182)
at com.bumptech.glide.Glide.getRetriever(Glide.java:749)
at com.bumptech.glide.Glide.with(Glide.java:801)
at com.example.button.ImageViewActivity.onCreate(ImageViewActivity.java:16)
at android.app.Activity.performCreate(Activity.java:7802)
at android.app.Activity.performCreate(Activity.java:7791)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1299)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3245)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3409)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2016)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7356)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
http://bumptech.github.io/glide/doc/download-setup.html
Note: Avoid using @aar in your dependencies whenever possible. If you must do so, add transitive = true to ensure that all necessary classes are included in your APK:
dependencies {
implementation ("com.github.bumptech.glide:glide:4.11.0@aar") {
transitive = true
}
}
提示的内容是找不到这类com/bumptech/glide/gifdecoder/GifDecoder$BitmapProvider,是不是混淆的问题,配置下
大概率 你是 viewgroup 和 imageView 调用了 同样的api
把引入的glide版本换成4.9.0试试
你可以看看这一篇文章:https://blog.csdn.net/qq_38436214/article/details/111885332