Android studio debug代码时不显示变量值

出现的问题:debug的时候断点走不到,同时也不显示变量值

报错信息:java.lang.ClassNotFoundException: com.bjmulian.emulian.core.AppCache
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:324)
at java.lang.Class.forName(Class.java:285)
at com.bjmulian.emulian.activity.SearchActivity2.d(SearchActivity2.java:265)
at com.bjmulian.emulian.activity.SearchActivity2.initViews(SearchActivity2.java:100)
at com.bjmulian.emulian.core.BaseActivity.onCreate(BaseActivity.java:54)
at android.app.Activity.performCreate(Activity.java:6497)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1108)
at cn.jiguang.a.a.d.a.a.d.callActivityOnCreate(Unknown Source)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2507)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2614)
at android.app.ActivityThread.access 1100(ActivityThread.java:165)atandroid.app.ActivityThread 1100 ( A c t i v i t y T h r e a d . j a v a : 165 ) a t a n d r o i d . a p p . A c t i v i t y T h r e a d H.handleMessage(ActivityThread.java:1482)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:179)
at android.app.ActivityThread.main(ActivityThread.java:5739)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:674)
Disconnected from the target VM, address: ‘localhost:8600’, transport: ‘socket’

问题分析:找不到类,最可能的原因是开启了混淆(我这次就是因为这个原因)
解决方法:minifyEnabled false ,如下
buildTypes {
debug {
minifyEnabled false
signingConfig signingConfigs.debug
testCoverageEnabled false
}

你可能感兴趣的:(android)