jashgopani
jashgopani

Reputation: 593

Android Studio 4 cannot detect java code and Cannot open SDK Manager,Settings

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

Error dialog

I tried all the options below but cannot solve the issue

JDK selection dialog

Upvotes: 1

Views: 1008

Answers (3)

Fury
Fury

Reputation: 61

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

plugin

Upvotes: 6

jashgopani
jashgopani

Reputation: 593

Finally after hours of debugging , here is how I solved all the issues.

Cause of the problem : Improper Update

  1. Checked IDE log, which was showing an exception thrown by a plugin. So I uninstalled that plugin.
  2. Deleted old folder of android studio .Android-studio-3.6 present inside C\Users\<Username>\
  3. 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.
  4. 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.

Upvotes: 0

Rishav81796
Rishav81796

Reputation: 26

I think you have not setup JDK.Try to setup JDK and i think it will help you to solve the problem.

Upvotes: 0

Related Questions