我刚刚将我的滑翔版本从3.7.0升级到4.6.0以获得更好的性能。在3.7.0中,它是从可绘制资源加载图像而没有任何问题但是在更新之后它在加载drawable时显示错误。我也尝试在SO和github中找到类似的问题,但没有一个能解决我的问题。
错误:
java.lang.NoClassDefFoundError: com.bumptech.glide.load.resource.gif.GifBitmapProvider
at com.bumptech.glide.load.resource.gif.ByteBufferGifDecoder.<init>(ByteBufferGifDecoder.java:70)
at com.bumptech.glide.load.resource.gif.ByteBufferGifDecoder.<init>(ByteBufferGifDecoder.java:56)
at com.bumptech.glide.Glide.<init>(Glide.java:339)
at com.bumptech.glide.GlideBuilder.build(GlideBuilder.java:472)
at com.bumptech.glide.Glide.initializeGlide(Glide.java:264)
at com.bumptech.glide.Glide.initializeGlide(Glide.java:219)
at com.bumptech.glide.Glide.checkAndInitializeGlide(Glide.java:180)
at com.bumptech.glide.Glide.get(Glide.java:164)
at com.bumptech.glide.Glide.getRetriever(Glide.java:670)
at com.bumptech.glide.Glide.with(Glide.java:747)
at layout.login.onCreateView(login.java:78)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:2261)
at android.support.v4.app.FragmentManagerImpl.ensureInflatedFragmentView(FragmentManager.java:1655)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1390)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1650)
at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1906)
at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:3698)
at android.support.v4.app.FragmentController.onCreateView(FragmentController.java:111)
at android.support.v4.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:350)
at android.support.v4.app.BaseFragmentActivityApi14.onCreateView(BaseFragmentActivityApi14.java:39)
at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:67)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:680)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at community.infinity.Login_Page.onCreate(Login_Page.java:60)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
我的代码:
Glide.with(this).load(R.drawable.tag).into(imgView);
答案 0 :(得分:0)
我直接使用了glide-full-4.4.0.jar(https://github.com/bumptech/glide/releases/download/v4.4.0/glide-full-4.4.0.jar),并解决了这个问题。