file was loaded in the wrong encoding: 'UTF-8' in android studio

半城伤御伤魂 提交于 2019-11-30 15:54:55

问题


my android studio gone crazy like this please help??

file was loaded in the wrong encoding: 'UTF-8' in android studio


回答1:


For people in future:

I had the same problem.

I was able to solve it simply by making a copy of the project and opened the copied project. Copied project worked perfectly fine.

Note: I got this problem because of improper shutdown of my PC.




回答2:


In my case it happend after Windows died with the blue screen, here's how I fixed it:

  1. Close Android Studio
  2. Find a directory named .AndroidStudioX.X in C:Users/YourUsername and rename it to old.AndroidStudioX.X
  3. Restart Android Studio and choose the renamed old.AndroidStudioX.X to import settings from.

My answer is taken from here https://stackoverflow.com/a/53476487/4277741




回答3:


That's not an encoding issue. That's compiled bytecode, the content of a .class file. You cannot simply rename it into .java and expect it to work.




回答4:


This is an old issue, but if anyone comes across this, what isn't mentioned above, but happening for me is that the original file on disk is intact java code. Android Studio is reading it like this for some reason.




回答5:


An encoding issue can be solved by deleting android cache folder. Just visit "C:\Users\.AndroidStdio3.5\" and delete cache folder.

Make sure that your android studio should be closed before deleting. Reopen your project in AndroidStudio once you finished with this operation, and sync it.



来源:https://stackoverflow.com/questions/39932158/file-was-loaded-in-the-wrong-encoding-utf-8-in-android-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!