设置android:debuggable = true时,Android bug会消失

时间:2013-12-16 10:33:04

标签: android debugging heisenbug

就像标题所说的那样。我的android应用程序中有一个错误(我粘贴了一些logcat输出以帮助识别它),当我使应用程序可调试时它会消失。现在问题是:除了在ddms中使应用程序进程“可检查”之外,debuggable标志还有什么作用?我认为这个问题的答案可以帮助我解决我原来的错误。

这是我的bug的logcat输出:

12-16 11:06:11.842    1359-1551/? I/ActivityManager﹕ Starting activity: Intent { cmp=com.mypackage/.MyActivity } from pid 6309
12-16 11:06:11.892    6309-6309/? W/dalvikvm﹕ VFY: 'this' arg 'Ljava/lang/Object;' not instance of 'Lcom/mypackage/e/w;'
12-16 11:06:11.892    6309-6309/? W/dalvikvm﹕ VFY:  rejecting opcode 0x6e at 0x0068
12-16 11:06:11.892    6309-6309/? W/dalvikvm﹕ VFY:  rejected Lcom/mypackage/MyActivity;.a (Lcom/mypackage/e/t;)V
12-16 11:06:11.892    6309-6309/? W/dalvikvm﹕ Verifier rejected class Lcom/mypackage/MyActivity;
12-16 11:06:11.892    6309-6309/? W/dalvikvm﹕ Class init failed in newInstance call (Lcom/mypackage/MyActivity;)
12-16 11:06:11.892    6309-6309/? W/dalvikvm﹕ threadid=1: thread exiting with uncaught exception (group=0x4001d5a0)
12-16 11:06:11.932    6309-6309/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.Throwable: java.lang.VerifyError: com.mypackage.MyActivity
    BOARD: spade
    BRAND: htc_wwenDEVICE: acenDISPLAY: GRJ90
    FINGERPRINT: htc_wwe/htc_ace/ace:2.3.5/GRJ90/$:user/release-keys
    HOST: ABM030
    ID: GRJ90
    MODEL: HTC Desire HD A9191
    PRODUCT: htc_ace
    VERSION.INCREMENTAL: 199157.1
    VERSION.RELEASE: 2.3.5
    VERSION.SDK: 10
            at com.mypackage.app.Application.uncaughtException(Unknown Source)
            at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:854)
            at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:851)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.VerifyError: com.mypackage.MyActivity
            at java.lang.Class.newInstanceImpl(Native Method)
            at java.lang.Class.newInstance(Class.java:1409)
            at android.app.Instrumentation.newActivity(Instrumentation.java:1040)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1777)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1893)
            at android.app.ActivityThread.access$1500(ActivityThread.java:135)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1054)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:150)
            at android.app.ActivityThread.main(ActivityThread.java:4385)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:507)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:849)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:607)
            at dalvik.system.NativeStart.main(Native Method)

0 个答案:

没有答案