0

我尝试使用 Diego 在以下帖子中的说明设置我的项目:http: //dtmilano.blogspot.com/2011/11/obtaining-code-coverage-of-running.html

在尝试使用启动应用程序时adb shell am instrument -e coverage true -w ...

我得到以下错误:

E/Trace   ( 3989): error opening trace file: No such file or directory (2)
W/Trace   ( 3989): Unexpected value from nativeGetEnabledTags: 0
W/Trace   ( 3989): Unexpected value from nativeGetEnabledTags: 0
W/Trace   ( 3989): Unexpected value from nativeGetEnabledTags: 0
I/dalvikvm( 3989): ****Could not find method com.vladium.emma.rt.RT.r, referenced from method com.adobe.dps.coverage.EmmaInstrumentation.$VRi
W/dalvikvm( 3989): VFY: unable to resolve static method 27137: Lcom/vladium/emma/rt/RT;.r ([[ZLjava/lang/String;J)V
D/dalvikvm( 3989): VFY: replacing opcode 0x71 at 0x004b
W/dalvikvm( 3989): Exception Ljava/lang/NoClassDefFoundError; thrown while initializing Lcom/adobe/dps/coverage/EmmaInstrumentation;
W/dalvikvm( 3989): Class init failed in newInstance call (Lcom/adobe/dps/coverage/EmmaInstrumentation;)
D/AndroidRuntime( 3989): Shutting down VM
W/dalvikvm( 3989): threadid=1: thread exiting with uncaught exception (group=0xb4cc7908)
E/AndroidRuntime( 3989): FATAL EXCEPTION: main
E/AndroidRuntime( 3989): java.lang.ExceptionInInitializerError

我在构建路径中包含了 emma.jar 并将其部署在应用程序中,但出现以下错误:

E/Trace   ( 4061): error opening trace file: No such file or directory (2)
W/Trace   ( 4061): Unexpected value from nativeGetEnabledTags: 0
W/Trace   ( 4061): Unexpected value from nativeGetEnabledTags: 0
W/Trace   ( 4061): Unexpected value from nativeGetEnabledTags: 0
W/dalvikvm( 4061): ****Exception Ljava/lang/Error; thrown while initializing Lcom/vladium/emma/rt/RT;
W/dalvikvm( 4061): Exception Ljava/lang/ExceptionInInitializerError; thrown while initializing Lcom/package/coverage/EmmaInstrumentation;
W/dalvikvm( 4061): Class init failed in newInstance call (Lcom/package/coverage/EmmaInstrumentation;)
D/AndroidRuntime( 4061): Shutting down VM
W/dalvikvm( 4061): threadid=1: thread exiting with uncaught exception (group=0xb4cc7908)
E/AndroidRuntime( 4061): FATAL EXCEPTION: main
E/AndroidRuntime( 4061): java.lang.ExceptionInInitializerError
E/AndroidRuntime( 4061):    at java.lang.Class.newInstanceImpl(Native Method)

知道如何解决这个问题吗?

谢谢!

4

2 回答 2

0

看来您应该执行以下命令:

“蚂蚁仪器”

因为你有这样的错误信息:****找不到方法 com.vladium.emma.rt.RT.r

于 2014-12-27T18:54:14.773 回答
0

下面的链接帮助我解决了这个问题。我正在使用添加以下依赖项:

在 app 文件夹中的 build.gradle 文件中添加了以下依赖项。

compile group: 'org.jruby', name: 'jruby', version: '1.4.1'

以及项目文件夹中存在的 build.gradle 文件中的以下依赖项。

maven {
            url "https://repo1.maven.org/maven2/"
        }

从以下链接中选择您的依赖项:http: //snacktrace.com/artifacts/org.jruby/jruby/1.4.1/com.vladium.emma.rt.RT

于 2017-05-05T12:01:17.733 回答