2

我试图通过在我的 mavenized android 项目上运行 ant emma 来获得覆盖率报告,其他一切都很顺利,但是我在运行时遇到了 NullPointerException

ant emma debug install test. 

输出是:

test:
 [echo] WARNING: Code Coverage is currently only supported on the emulator and rooted devices.
 [echo] Running tests ...
 [exec] 
 [exec] com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp.MainActivityTest:INSTRUMENTATION_RESULT: shortMsg=java.lang.NullPointerException
 [exec] INSTRUMENTATION_RESULT: longMsg=java.lang.NullPointerException: Unable to start activity ComponentInfo{com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp/com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp.MainActivity}: java.lang.NullPointerException
 [exec] INSTRUMENTATION_CODE: 0
 [echo] Downloading coverage file into project directory...
 [exec] remote object '/data/data/com.jayway.maven.plugins.android.generation2.samples.libraryprojects.mainapp/coverage.ec' does not exist

我该如何调试呢?我想知道 NPE 发生在哪里。

4

0 回答 0