方法一
Settings->File Encodings->IDE Encodeing->UTF-8
在build.gradle里加入下面的配置
tasks.withType(Compile) {
options.encoding = "UTF-8"
options.encoding = "UTF-8"
}
Settings->File Encodings->IDE Encodeing->UTF-8
Settings->File Encodings->Project Encodeing->UTF-8
在build.gradle里加入下面的配置
tasks.withType(Compile) {
options.encoding = "UTF-8"
}
但是这个配置在gradle2.0以前是可以生效的,在gradle2.0以后就不能生效了,原因是Compile已 经被重命名为JavaCompile,所以在gradle2.0以后需要添加的配置如下
options.encoding = "UTF-8"
}