android studio错误: 编码GBK的不可映射字符

害,今天又是出现各种错误的一天:
在这里插入图片描述

解决方法:

在模块的build.gradle中加入:

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

JavaCompile意思编译java代码时使用utf-8编码,然后就完美解决了!!!

猜你喜欢

转载自blog.csdn.net/weixin_43912621/article/details/105808681