所有的android项目文件编码错误 [英] All android project file encoded wrongly

查看:60
本文介绍了所有的android项目文件编码错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我所有的android studio文件都未显示原始代码.所有受影响的Java和XML文件.当我打开文件时,它显示文件已以错误的编码方式加载:'UTF-8'.我尝试重新加载另一种编码方式,但问题未解决.我可以在记事本中看到代码,但是在android studio中看不到.

在记事本中显示的CustomApplication.java原始代码

package satlaa.desijewellery.utils;
import android.app.Application;
import android.content.Context;
import android.content.res.Configuration;

public class CustomApplication extends Application {

@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(LocaleHelper.onAttach(base, "hi"));
}
}

在Android Studio中

AAPT               ,  �       
&layout/abc_alert_dialog_title_material 
"�C:\Users\Anjaan\.gradle\caches\transforms-1\files-1.1\appcompat-v7- 

27.1.1.aar \ 11bca4c6723b60847116b8b51872d16b \ res \ layout \ abc_alert_dialog_title_m aterial.xml * id/alertTitle- * id/titleDividerNoCustom8 * id/title_template * id/topPanel 9 android * http

我什至可以在这里设置为代码.

解决方案

转到:

File -> Other Settings -> Default Settings,找到File Encodings,将Project Encoding更改为System-Default和其他设置,如下所示:

如果这样做没有帮助,请尝试重新安装Android Studio(如果尚未使用,请安装最新版本).

All my android studio file is not showing original code. All java and XML file affected. When I open a file it shows "File was loaded in the wrong encoding:'UTF-8'. I tried to reload in another coding but problem not resolved. I can see code in Notepad but not in android studio.

CustomApplication.java Original Code showing in Notepad

package satlaa.desijewellery.utils;
import android.app.Application;
import android.content.Context;
import android.content.res.Configuration;

public class CustomApplication extends Application {

@Override
protected void attachBaseContext(Context base) {
    super.attachBaseContext(LocaleHelper.onAttach(base, "hi"));
}
}

In Android Studio

AAPT               ,  �       
&layout/abc_alert_dialog_title_material 
"�C:\Users\Anjaan\.gradle\caches\transforms-1\files-1.1\appcompat-v7- 

27.1.1.aar\11bca4c6723b60847116b8b51872d16b\res\layout\abc_alert_dialog_title_m aterial.xml* id/alertTitle-* id/titleDividerNoCustom8* id/title_template* id/topPanel � 9 android*http

I can even set here as code.

解决方案

Go to :

File -> Other Settings -> Default Settings, find File Encodings, change Project Encoding to System-Default and the other settings as follows:

If this didn't help, try reinstalling the Android Studio (or install the latest version if you already don't use it).

这篇关于所有的android项目文件编码错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆