有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

重建后Android Studio(R.java文件)上的编码错误

最近,我从某家回购公司导入了一个安卓 studio项目。该项目最初是在linux/ubuntu环境中编写的,没有任何问题。现在我想在windows中工作,但build在R.java(自动生成的文件)中给了我一些错误:

error: illegal character: '\u00a9'

我在internet上找到的一些信息建议我使用此解决方案:

set the right file encoding in your build.gradle script:

compileOptions.encoding = 'windows-1251' // write your encoding here

我已经补充了,但仍然是同一个问题。我做错了什么


资源:

建造。格拉德尔

apply plugin: 'com.安卓.application'

安卓 {
    compileSdkVersion 25
    buildToolsVersion '25.0.0'
    ...
    compileOptions.encoding = 'windows-1251'
...

R.java(有错误的行):

...
    public static final int country_réunion_code=0x7f0a0381;
    public static final int country_réunion_name=0x7f0a01df;
    public static final int country_réunion_number=0x7f0a0382;
...

编码设置: This is the image for settings if needed

Android Studio 3.1.3


共 (0) 个答案