shwenzhang / AndResGuard

proguard resource for Android by wechat team
Apache License 2.0
8.54k stars 1.54k forks source link

运行报如下错误,貌似与Glide图片框架有冲突 #359

Open 214024475 opened 5 years ago

214024475 commented 5 years ago

2019-07-18 17:46:51.359 30945-30945/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.dandelion.shurong, PID: 30945 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dandelion.shurong/com.dandelion.shurong.mvp.accout.ui.SplashActivity}: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class com.pgy.mvp.imageloader.GlideImageView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3300) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3484) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2123) at android.os.Handler.dispatchMessage(Handler.java:109) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:7470) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958) Caused by: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class com.pgy.mvp.imageloader.GlideImageView Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class com.pgy.mvp.imageloader.GlideImageView Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:343) at android.view.LayoutInflater.createView(LayoutInflater.java:658) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:801) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741) at android.view.LayoutInflater.rInflate(LayoutInflater.java:874) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:835) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at android.view.LayoutInflater.inflate(LayoutInflater.java:374) at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at com.pgy.mvp.mvp.PgyActivity.onCreate(PgyActivity.java:55) at com.dandelion.shurong.mvp.accout.ui.SplashActivity.onCreate(SplashActivity.java:53) at android.app.Activity.performCreate(Activity.java:7436) at android.app.Activity.performCreate(Activity.java:7426) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3279) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3484) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2123) at android.os.Handler.dispatchMessage(Handler.java:109) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:7470) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958) Caused by: java.lang.IllegalArgumentException: Unable to find GlideModule implementation at ks.a(ManifestParser.java:69) at ks.a(ManifestParser.java:47) at br.b(Glide.java:230) at br.e(Glide.java:221) at br.d(Glide.java:182) at br.b(Glide.java:166) at br.f(Glide.java:680) at br.c(Glide.java:707) at acv.c(GlideApp.java:88)

ysbing commented 5 years ago

你直接new一个com.pgy.mvp.imageloader.GlideImageView对象出来看看有没异常

DysaniazzZ commented 3 years ago

2019-07-18 17:46:51.359 30945-30945/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.dandelion.shurong, PID: 30945 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.dandelion.shurong/com.dandelion.shurong.mvp.accout.ui.SplashActivity}: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class com.pgy.mvp.imageloader.GlideImageView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3300) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3484) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2123) at android.os.Handler.dispatchMessage(Handler.java:109) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:7470) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958) Caused by: android.view.InflateException: Binary XML file line #17: Binary XML file line #17: Error inflating class com.pgy.mvp.imageloader.GlideImageView Caused by: android.view.InflateException: Binary XML file line #17: Error inflating class com.pgy.mvp.imageloader.GlideImageView Caused by: java.lang.reflect.InvocationTargetException at java.lang.reflect.Constructor.newInstance0(Native Method) at java.lang.reflect.Constructor.newInstance(Constructor.java:343) at android.view.LayoutInflater.createView(LayoutInflater.java:658) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:801) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:741) at android.view.LayoutInflater.rInflate(LayoutInflater.java:874) at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:835) at android.view.LayoutInflater.inflate(LayoutInflater.java:515) at android.view.LayoutInflater.inflate(LayoutInflater.java:423) at android.view.LayoutInflater.inflate(LayoutInflater.java:374) at android.support.v7.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:469) at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) at com.pgy.mvp.mvp.PgyActivity.onCreate(PgyActivity.java:55) at com.dandelion.shurong.mvp.accout.ui.SplashActivity.onCreate(SplashActivity.java:53) at android.app.Activity.performCreate(Activity.java:7436) at android.app.Activity.performCreate(Activity.java:7426) at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1286) at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3279) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3484) at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:86) at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108) at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2123) at android.os.Handler.dispatchMessage(Handler.java:109) at android.os.Looper.loop(Looper.java:207) at android.app.ActivityThread.main(ActivityThread.java:7470) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:524) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:958) Caused by: java.lang.IllegalArgumentException: Unable to find GlideModule implementation at ks.a(ManifestParser.java:69) at ks.a(ManifestParser.java:47) at br.b(Glide.java:230) at br.e(Glide.java:221) at br.d(Glide.java:182) at br.b(Glide.java:166) at br.f(Glide.java:680) at br.c(Glide.java:707) at acv.c(GlideApp.java:88)

你好,你的问题解决了吗

DysaniazzZ commented 3 years ago

我这里遇到的问题时接入这个的时候,glide 直接加载资源 id 就有问题了,比如通过 context 获取到 drawable 然后再加载,也就是 Glide.with(context).load(context.getResources().getDrawable(resId)).into(view); 这样就没问题,但是 Glide.with(context).load(resId).into(view); 这样就有问题。