由 groovy.lang.MissingPropertyException 引起无法获取未知属性'android'对于项目 ':lib1'类型为 org.gradle.api.Project
要解决我的问题此处:应用 JaCoCo对于所有 Android Studio gradle 模块,我应用了解决方案 这里。到目前为止,对于带有以下内容的模块来说效果很好
plugins {
id("com.android.library")
}
一旦我将所需的 apply from: '../jacoco/modules.gradle'
添加到标记为 Java 库的模块中
plugins {
id("java-library")
}
,我就会得到一个
Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'android' for project ':lib1' of type org.gradle.api.Project.
I would like将 apply from
添加到 java 库,以便也为它们生成 JaCoCo 报告。我在这里想念什么?
To solve my problem here: Applying JaCoCo to all Android Studio gradle modules, I applied the solution here. This works fine so far for modules with
plugins {
id("com.android.library")
}
As soon as I add the required apply from: '../jacoco/modules.gradle'
into a module labeled as a Java library
plugins {
id("java-library")
}
I get a
Caused by: groovy.lang.MissingPropertyException: Could not get unknown property 'android' for project ':lib1' of type org.gradle.api.Project.
I would like to add the apply from
to the java library, so that JaCoCo reports were generated for them as well. What am I missin here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设您还从您已链接的解决方案
../ jacoco/modules.gradle
文件?在这种情况下,您可以用以下内容替换该片段:如果不能解决它,那么我建议使用gradle的
- stacktrace
选项运行构建。这应该为您提供更多详细信息,以了解丢失的财产的确切位置。没有有关您确切构建设置的更多信息,很难真正说出更多信息。
I assume you have also applied the snippet from the “Improvements” section of the solution you have linked to your
../jacoco/modules.gradle
file? In that case you could replace that snippet with the following:If that doesn’t solve it, then I’d recommend to run the build with Gradle’s
--stacktrace
option. That should give you more details on where exactly the missing property was found.Without more information on your exact build setup it’s hard to really say more.
对于
Cordova
- 一些过时的软件包导致它 - 请参阅 https ://github.com/google/cordova-plugin-browsertab/issues/43 & https://github.com/apache/cordova-android/issues/821,例如我们的cordova-plugin-browsertab
。有多种方法可以解决这个问题,甚至是 来自 Cordova 文档的示例。
那个对我有用的 - 在
gradle.properties
中添加cdvMinSdkVersion=21
。没有尝试过其他的,但根据 cordova-plugin -browsertab#43(评论),它至少应该可以作为环境变量导出。For
Cordova
- some outdated packages cause it - see https://github.com/google/cordova-plugin-browsertab/issues/43 & https://github.com/apache/cordova-android/issues/821, such uscordova-plugin-browsertab
.There are multiple ways to solve this, it's even an example from Cordova docs.
That one working for me - add
cdvMinSdkVersion=21
insidegradle.properties
. Haven't tried the other ones, but as per cordova-plugin-browsertab#43 (comment), it should work at least with exporting as environmental variable.