更新Gradle和构建工具后缺少Android JAVA字节代码
我正在使用Jacoco创建一份覆盖率报告,并且在更新Gradle和BuildTools版本之前一直工作良好。然后我恢复这些更改并重新工作。
I'm using Jacoco to create a coverage report and that was working fine until update Gradle and BuildTools version. Then I revert those changes and work again.
Jacoco在以下位置查找 .class 文件:
Jacoco looks for .class files in here:
$ {buildDir} / intermediates / classes / debug
${buildDir}/intermediates/classes/debug
这是 app / build / intermediates / classes / debug 。但是我注意到,升级后该路径丢失了,中间体
This is app/build/intermediates/classes/debug. But I've notice that after the upgrade that path is missing, there's no classes dir inside intermediates
我的有效的配置:
项目级别模块
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'io.fabric.tools:gradle:1.25.1'
应用级别模块
compileSdkVersion 27
buildToolsVersion "27.0.3"
当更新时,此为:
项目级别模块
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'io.fabric.tools:gradle:1.25.4'
应用级模块
compileSdkVersion 28
buildToolsVersion "28.0.3"
我找不到关于该路径被移动的任何参考,或者
I could not find any reference about that path being moved or what could be going on
我的问题是,就像Java字节码(生成的.class文件)那样不存在,则Jacoco无法创建承保报告
My problem is that as the Java Byte Code (generated .class files) does not exists, then Jacoco can not create a coverage report
它们在 intermediates\javac under下\debug\compileDebugJavaWithJavac\classes
您可以配置Jacoco来更改类路径。
You can configure Jacoco to change the classes path.
我不熟悉Jacoco,但我认为它有一个名为 includes
的属性,用于.class文件。
I'm not familiar with Jacoco but I think it has a property named includes
which is used for .class files.
或者我想应该有一个 .properties
。
Or there should be a .properties
for it I guess.