Android Studio: Failed to initialize editor

♀尐吖头ヾ 提交于 2021-01-06 02:01:27

问题


I'm new with Android Studio technology. I've just launched a new empty project from scratch on Windows 10 machine. At first in my activity_main.xml file I could see an error "editor is unavaible until next gradle synch". After clicking on "Synch Project with Gradle Files" the error message turns into "Failed to initialize editor" as you can see on the pic below:

As you can see build console shows no errors. Also green arrow on the top bar is muted. How can I fix this issue?

Android Studio version: 4.02 JDK version: 1.8.0_261

Note I've got Avast Antivirus installed on my computer. I'm not sure if it changes anything but in few similar topics people repored this program as an issue interfering with Android Studio. However my avast quarantine remains empty.

Update/Solution In my case it turned out that downgrading my Android Studio from 4.0.2 to 3.5.3 version solved this problem. Now everything works fine.


回答1:


I don't know for sure what causes this error but you can solve it by first closing the project and deleting the project.xml file in the .idea\codeStyles\ directory of your project, as soon as you reopen your project you will get a popup prompting you to reconfigure this file, after that everything should be okay,




回答2:


I don't know why it happened, it happened for me on a project that was working earlier. Helped me File -> Invalidate Cashes / Restart in Android Studio




回答3:


In my case, I simply had to exit Android Studio and relaunch it. :)



来源:https://stackoverflow.com/questions/63750128/android-studio-failed-to-initialize-editor

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