AndroidNote icon indicating copy to clipboard operation
AndroidNote copied to clipboard

AS Gradle 错误: 编码 GBK 的不可映射字符

Open GcsSloop opened this issue 8 years ago • 2 comments

产生原因:

存在中文注释,且编码为utf-8。

解决方案:

指定编译字符集为utf-8。

在所在项目之下的build.gradle中添加:

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

注:由于Gradlev2.2.1的升级,语法不向下兼容。之前解决这个问题的方法是添加:

tasks.withType(Compile) { options.encoding = “UTF-8” }

GcsSloop avatar Feb 08 '16 19:02 GcsSloop

学习了

TJYOYO avatar May 19 '16 02:05 TJYOYO

can not solve my problem. i tried this paraph in all build.gradle,but no effect.can you help me ?

zyxzhangyuxia avatar Aug 01 '17 03:08 zyxzhangyuxia