android glide com.networkbench.agent.impl.instrumentation.NBSTraceEngine

         在使用Glide的框架的时候,碰到一个奇葩的问题,报错信息如下:

Process: com.juwang.androidglide, PID: 22694
         java.lang.NoClassDefFoundError: Failed resolution of: Lcom/networkbench/agent/impl/instrumentation/NBSTraceEngine;
              at com.bumptech.glide.manager.SupportRequestManagerFragment.onCreate(SupportRequestManagerFragment.java)
              at android.support.v4.app.Fragment.performCreate(Fragment.java:2180)
              at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1244)
              at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528)
              at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595)
              at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:758)
              at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2363)
              at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2149)
              at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2103)
              at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2013)
              at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388)
              at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:607)
              at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
              at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1236)
              at android.app.Activity.performStart(Activity.java:6055)
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2305)
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2404)
              at android.app.ActivityThread.access$800(ActivityThread.java:154)
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1315)
              at android.os.Handler.dispatchMessage(Handler.java:102)
              at android.os.Looper.loop(Looper.java:135)
              at android.app.ActivityThread.main(ActivityThread.java:5290)
              at java.lang.reflect.Method.invoke(Native Method)
              at java.lang.reflect.Method.invoke(Method.java:372)
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911)
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706)
      Caused by: java.lang.ClassNotFoundException: Didn't find class "com.networkbench.agent.impl.instrumentation.NBSTraceEngine" on path: DexPathList[[zip file "/data/app/com.juwang.androidglide-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
              at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
              at com.bumptech.glide.manager.SupportRequestManagerFragment.onCreate(SupportRequestManagerFragment.java) 
              at android.support.v4.app.Fragment.performCreate(Fragment.java:2180) 
              at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1244) 
              at android.support.v4.app.FragmentManagerImpl.moveFragmentToExpectedState(FragmentManager.java:1528) 
              at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1595) 
              at android.support.v4.app.BackStackRecord.executeOps(BackStackRecord.java:758) 
              at android.support.v4.app.FragmentManagerImpl.executeOps(FragmentManager.java:2363) 
              at android.support.v4.app.FragmentManagerImpl.executeOpsTogether(FragmentManager.java:2149) 
              at android.support.v4.app.FragmentManagerImpl.optimizeAndExecuteOps(FragmentManager.java:2103) 
              at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:2013) 
              at android.support.v4.app.FragmentController.execPendingActions(FragmentController.java:388) 
              at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:607) 
              at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178) 
              at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1236) 
              at android.app.Activity.performStart(Activity.java:6055) 
              at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2305) 
              at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2404) 
              at android.app.ActivityThread.access$800(ActivityThread.java:154) 
              at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1315) 
              at android.os.Handler.dispatchMessage(Handler.java:102) 
              at android.os.Looper.loop(Looper.java:135) 
              at android.app.ActivityThread.main(ActivityThread.java:5290) 
              at java.lang.reflect.Method.invoke(Native Method) 
              at java.lang.reflect.Method.invoke(Method.java:372) 
              at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:911) 
              at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:706) 
                  Suppressed: java.lang.ClassNotFoundException: com.networkbench.agent.impl.instrumentation.NBSTraceEngine
              at java.lang.Class.classForName(Native Method)
              at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
              at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
                               ... 27 more
        Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available

经过排查才知道,原来是引用的Glide的版本有问题。出现这个问题是因为我引用的Glide的版本是3.7.0,把Glide的版本降低点就不会出现这种问题了。至于为什么3.7.0会出现这样的问题,我还没有搞懂,欢迎明白的同学在下面留言,不胜感激

你可能感兴趣的:(Android)