英文:
Android Studio 4 cannot detect java code and Cannot open SDK Manager,Settings
问题
以下是翻译好的部分:
我刚刚更新到了最新版本的Android Studio,并且执行了“无效缓存并重启”的操作,但在此之后,我的项目文件全部显示为红色,Android Studio 无法检测到Java。每当我将鼠标悬停在红线上时,会显示“配置JDK”选项。我已经从Oracle网站下载了最新的JDK,并在Java路径中选择了它,但仍然无法解决问题。我无法打开设置、SDK管理器,也无法配置SDK。
下面是错误对话框的截图
我尝试了下面的所有选项,但问题仍然无法解决
英文:
I just updated
to latest android studio and had invalidated caches and restart
but after that my project files are all red and android studio cannot detect java.
Whenever I hover on red line, It shows a configure JDK
option.
I had downloaded latest jdk from oracle website and selected that in java path but that also didn't work. I am not able to open settings, SDK manager, neither can I configure SDK.
> Below is the error dialog
> I tried all the options below but cannot solve the issue
答案1
得分: 6
在我的情况下是CSV插件
出了问题。
在我注意到状态栏右侧有一个错误提示说CSV插件启动失败后,我在“报告问题”对话框中禁用了这个插件。
然后重新启动Android Studio就能解决无法打开设置的问题。
英文:
In my case is the CSV Plugin
's fault.
After I noticed en error in the right of the status bar said that CSV plugin startup failed, then I disabled this plugin in the Report Issue dialog
Then restart Android Studio will fix the cannot open settings problem
答案2
得分: 0
我认为你还没有设置JDK。尝试设置JDK,我认为这会帮助你解决问题。
英文:
I think you have not setup JDK.Try to setup JDK and i think it will help you to solve the problem.
答案3
得分: 0
Finally after hours of debugging, here is how I solved all the issues.
> 问题的原因:更新不当
- 检查了 IDE 日志,显示一个插件抛出的异常。所以我卸载了那个插件。
- 删除了旧文件夹
C\Users\<Username>\
中的 Android Studio 旧版本文件夹.Android-studio-3.6
。 - 大部分错误消失了,但是 Android Studio 显示了一个警告 “为构建 Gradle 选择了两个不同的 JDK 位置...”,所以我打开控制面板,删除了除了我从 Oracle 网站 下载的最新 JDK
14.0.1
之外的所有旧版本 Java。 - 仍然显示相同的错误,所以我从 官网 下载了 Android Studio 4.0 的可执行文件,并进行了 重新安装。在重新安装时,我没有选择安装 Android 虚拟设备,因为它已经安装好了。
英文:
Finally after hours of debugging , here is how I solved all the issues.
> Cause of the problem : Improper Update
- Checked IDE log, which was showing an exception thrown by a plugin. So I uninstalled that plugin.
- Deleted old folder of android studio
.Android-studio-3.6
present insideC\Users\<Username>\
- Most of the errors were gone but android studio was shwowing a warning "Two different JDK locations are selected for building gradle....", so I went to control panel and deleted all old versions of java except for the latest JDK
14.0.1
which I downloaded from Oracle website. - Still it was showing the same error so I downloaded Android Studio 4.0 exe file from their website and re-installed Android studio. While Reinstalling, I did not select Android Virtual device as it was already installed.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论