还未发布过话题
  • @doctorq 好的 谢了 我再看看

  • @doctorq 直接停的 app 是在 genymotion 运行的

  • @doctorq 有的

  • @doctorq android studio 1.1.0 android sdk 22

  • @doctorq 恩 是按照上面的步骤来做的 我回复的错误 log 是 logcat 中的 因为 file 下面的 coverage.ec 文件是 0 字节

  • @doctorq 我看到参考的那个 blog 里面是 ant instrument 没有影响吧?

  • @doctorq 恩 已经 gradlew clean build 的 并重新安装的 apk

  • @doctorq 想问一下你是 gradle build 的吧 jacoco 加入 compile 还是报错提示 java.lang.ClassNotFoundException: org.jacoco.agent.rt.RT

    D/JacocoInstrumentation:( 1559): onActivityFinished()
    D/JacocoInstrumentation:( 1559): generateCoverageReport():/data/data/com.example/files/coverage.ec
    D/JacocoInstrumentation:( 1559): java.lang.ClassNotFoundException: org.jacoco.agent.rt.RT
    D/JacocoInstrumentation:( 1559): java.lang.ClassNotFoundException: org.jacoco.agent.rt.RT
    D/JacocoInstrumentation:( 1559):        at java.lang.Class.classForName(Native Method)
    D/JacocoInstrumentation:( 1559):        at java.lang.Class.forName(Class.java:204)
    D/JacocoInstrumentation:( 1559):        at java.lang.Class.forName(Class.java:169)
    D/JacocoInstrumentation:( 1559):        at com.example.test.JacocoInstrumentation.generateCoverageReport(JacocoInstrumentation.java:83)
    D/JacocoInstrumentation:( 1559):        at com.example.test.JacocoInstrumentation.onActivityFinished(JacocoInstrumentation.java:134)
    D/JacocoInstrumentation:( 1559):        at com.example.test.InstrumentedActivity.onDestroy(InstrumentedActivity.java:22)
    D/JacocoInstrumentation:( 1559):        at android.app.Activity.performDestroy(Activity.java:5302)
    D/JacocoInstrumentation:( 1559):        at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1117)
    D/JacocoInstrumentation:( 1559):        at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:3486)
    D/JacocoInstrumentation:( 1559):        at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:3517)
    D/JacocoInstrumentation:( 1559):        at android.app.ActivityThread.access$1200(ActivityThread.java:141)
    D/JacocoInstrumentation:( 1559):        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1309)
    D/JacocoInstrumentation:( 1559):        at android.os.Handler.dispatchMessage(Handler.java:99)
    D/JacocoInstrumentation:( 1559):        at android.os.Looper.loop(Looper.java:137)
    D/JacocoInstrumentation:( 1559):        at android.app.ActivityThread.main(ActivityThread.java:5103)
    D/JacocoInstrumentation:( 1559):        at java.lang.reflect.Method.invokeNative(Native Method)
    D/JacocoInstrumentation:( 1559):        at java.lang.reflect.Method.invoke(Method.java:525)
    D/JacocoInstrumentation:( 1559):        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
    D/JacocoInstrumentation:( 1559):        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
    D/JacocoInstrumentation:( 1559):        at dalvik.system.NativeStart.main(Native Method)
    D/JacocoInstrumentation:( 1559): Caused by: java.lang.NoClassDefFoundError: org/jacoco/agent/rt/RT
    D/JacocoInstrumentation:( 1559):        ... 20 more
    D/JacocoInstrumentation:( 1559): Caused by: java.lang.ClassNotFoundException: Didn't find class "org.jacoco.agent.rt.