问题描述
我是 Android Studio 技术的新手.我刚刚在 Windows 10 机器上从头启动了一个新的空项目.起初,在我的 activity_main.xml 文件中,我可以看到一个错误编辑器在下一个 gradle 同步之前不可用".点击Synch Project with Gradle Files"后错误消息变成无法初始化编辑器"如下图所示:
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 版本:4.02JDK 版本:1.8.0_261
Android Studio version: 4.02JDK version: 1.8.0_261
注意 我的计算机上安装了 Avast Antivirus.我不确定它是否有任何改变,但在一些类似的主题中,人们将此程序报告为干扰 Android Studio 的问题.然而,我的 avast 隔离区仍然是空的.
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.
更新/解决方案 就我而言,结果证明将我的 Android Studio 从 4.0.2 降级到 3.5.3 版本解决了这个问题.现在一切正常.
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.
推荐答案
我不确定是什么导致了这个错误,但是你可以通过先关闭项目并删除 .idea\ 中的 project.xml 文件来解决它codeStyles\ 目录下,只要你重新打开你的项目,你就会弹出一个提示你重新配置这个文件的文件,之后一切都应该没问题了,
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,
这篇关于Android Studio:无法初始化编辑器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!