java.io.FileNotFoundException: /jacoco.exec: 打开失败:EROFS(只读文件系统)
java.io.FileNotFoundException: /jacoco.exec: open failed: EROFS (Read-only file system)
在尝试实施 JaCoCo 离线检测时遇到这个问题。
W/System.err( 1733): java.io.FileNotFoundException: /jacoco.exec: open failed: EROFS (Read-only file system)
W/System.err( 1733): at libcore.io.IoBridge.open(IoBridge.java:456)
W/System.err( 1733): at java.io.FileOutputStream.<init>(FileOutputStream.java:89)
--
W/System.err( 1733): at libcore.io.IoBridge.open(IoBridge.java:456)
W/System.err( 1733): at java.io.FileOutputStream.<init>(FileOutputStream.java:89)
W/System.err( 1733): at org.jacoco.agent.rt.internal_14f7ee5.output.FileOutput.openFile(FileOutput.java:67)
W/System.err( 1733): at org.jacoco.agent.rt.internal_14f7ee5.output.FileOutput.startup(FileOutput.java:49)
W/System.err( 1733): at org.jacoco.agent.rt.internal_14f7ee5.Agent.startup(Agent.java:122)
W/System.err( 1733): at org.jacoco.agent.rt.internal_14f7ee5.Agent.getInstance(Agent.java:50)
W/System.err( 1733): at org.jacoco.agent.rt.internal_14f7ee5.Offline.<clinit>(Offline.java:31)
我认为忽略离线检测警告是安全的,因为路径应该类似:executionData = files("${project.buildDir}/jacoco/${testTaskName}.exec")
(在 PC 上 - 因此无需将其保存在设备上然后拉取文件).
在 Android 这会将 JaCoCo 代理添加到 APK 中:
buildTypes {
debug {
testCoverageEnabled = true
}
}
jacoco 中的解决方案是 well-documented 但对于 Android 人,您需要在 /src/androidTest/resources/jacoco-agent.properties
中添加内容为 output=none
的文件,以便 jacoco 可以启动没有失败,并且覆盖将正常写入并稍后由 android gradle 插件覆盖实现正确传输。
在尝试实施 JaCoCo 离线检测时遇到这个问题。
W/System.err( 1733): java.io.FileNotFoundException: /jacoco.exec: open failed: EROFS (Read-only file system)
W/System.err( 1733): at libcore.io.IoBridge.open(IoBridge.java:456)
W/System.err( 1733): at java.io.FileOutputStream.<init>(FileOutputStream.java:89)
--
W/System.err( 1733): at libcore.io.IoBridge.open(IoBridge.java:456)
W/System.err( 1733): at java.io.FileOutputStream.<init>(FileOutputStream.java:89)
W/System.err( 1733): at org.jacoco.agent.rt.internal_14f7ee5.output.FileOutput.openFile(FileOutput.java:67)
W/System.err( 1733): at org.jacoco.agent.rt.internal_14f7ee5.output.FileOutput.startup(FileOutput.java:49)
W/System.err( 1733): at org.jacoco.agent.rt.internal_14f7ee5.Agent.startup(Agent.java:122)
W/System.err( 1733): at org.jacoco.agent.rt.internal_14f7ee5.Agent.getInstance(Agent.java:50)
W/System.err( 1733): at org.jacoco.agent.rt.internal_14f7ee5.Offline.<clinit>(Offline.java:31)
我认为忽略离线检测警告是安全的,因为路径应该类似:executionData = files("${project.buildDir}/jacoco/${testTaskName}.exec")
(在 PC 上 - 因此无需将其保存在设备上然后拉取文件).
在 Android 这会将 JaCoCo 代理添加到 APK 中:
buildTypes {
debug {
testCoverageEnabled = true
}
}
jacoco 中的解决方案是 well-documented 但对于 Android 人,您需要在 /src/androidTest/resources/jacoco-agent.properties
中添加内容为 output=none
的文件,以便 jacoco 可以启动没有失败,并且覆盖将正常写入并稍后由 android gradle 插件覆盖实现正确传输。