当前位置: 首页 > 知识库问答 >
问题:

升级到Gradle 2.0后:在根项目上找不到属性“Compile”

束俊材
2023-03-14

为了避免在构建Java源代码时出现有关特殊字符的警告,我在Gradle.build中添加了这一行,在升级到Gradle2.0之前,这一行工作良好:

tasks.withType(Compile) { options.encoding = "UTF-8" }
Could not find property 'Compile' on root project

我该怎么解决呢?

共有1个答案

敖涵容
2023-03-14

将行更改为

tasks.withType(JavaCompile) { options.encoding = "UTF-8" }

修正了这个问题。

 类似资料: