我勒个天啊,就一个听云缓存整了两天,本以为在C:\Users\用户.gradle\daemon\2.14.1 此目录下删除对应的两个文件registry.bin、registry.bin.lock就可以,但一直不行;
点击按钮后触发点击事件,崩溃
报错信息如下:
Process: com.example.g_emall.photopickerdemo, PID: 8849
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.Fragment.performStart(Fragment.java:2214)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1340)
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.FragmentManagerImpl.dispatchStart(FragmentManager.java:2907)
at android.support.v4.app.FragmentController.dispatchStart(FragmentController.java:212)
at android.support.v4.app.FragmentActivity.onStart(FragmentActivity.java:613)
at android.support.v7.app.AppCompatActivity.onStart(AppCompatActivity.java:178)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1248)
at android.app.Activity.performStart(Activity.java:6679)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2609)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2707)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1460)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.networkbench.agent.impl.instrumentation.NBSTraceEngine" on path: DexPathList[[zip file "/data/app/com.example.g_emall.photopickerdemo-2/base.apk", zip file "/data/app/com.example.g_emall.photopickerdemo-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.example.g_emall.photopickerdemo-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.example.g_emall.photopickerdemo-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.example.g_emall.photopickerdemo-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.example.g_emall.photopickerdemo-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.example.g_emall.photopickerdemo-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.example.g_emall.photopickerdemo-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.example.g_emall.photopickerdemo-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.example.g_emall.photopickerdemo-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.example.g_emall.photopickerdemo-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.example.g_emall.photopickerdemo-2/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.example.g_emall.photopickerdemo-2/lib/x86, /system/lib, /vendor/lib]]
原因
因为Android Studio为了提高编译的速度,加入了 daemon的缓存机制,这个缓存导致调用听云的SDK,产生一些莫名其妙的Bug,因此解决问题的方法就是: 换个工作空间,通俗的说就是 换个新项目的保存位置
解决
最简单粗暴的方法就是重建一个新项目 new Project
待续...若之后有更好的方法