MattiahIT
MattiahIT

Reputation: 87

Why Android Studio is showing errors "everywhere in code" after last update?

Yesterday I have updated my AndroidStudio IDE and after that I see strange error everywhere, even on fresh project: enter image description here

there is also message:

Cannot access 'android.app.Activity' which is a supertype of 'pl.testapp.MainActivity'. Check your module classpath for missing or conflicting dependencies. Cannot access 'java.lang.Object' which is a supertype of 'pl.testapp.MainActivity'. Check your module classpath for missing or conflicting dependencies.

I can build project but writing code where everything is underlined is horrible ;p. I have already tried to reinstall IDE but with no result. Have you ever experienced that?

Upvotes: 1

Views: 3077

Answers (5)

Prabhat kumar Tiwari
Prabhat kumar Tiwari

Reputation: 11

This issue occurs only when all the dependencies will not be dowloaded after opening the android studio that's why it show the error .

Follow the steps to resolve the issue Step 1. Clean the project Clean Step 2. Rebuild the projet. Rebuild

This issue will be resolve

Upvotes: 1

This usually happens when the IDE's executable is moved to another folder. Close the IDE and rename the folder containing the IDE settings to recreate it. In my case the path to the settings folder was: /home/myLinuxUser/.config/Google/AndroidStudio2020.3 So I renamed "AndroidStudio2020.3" to "AndroidStudio2020.3__OLD". After that, go to the IDE again and open your project.

Upvotes: 2

davidfrancis
davidfrancis

Reputation: 3849

For anyone else running into this in 2021 and beyond.
I found that one of my Sdk's was corrupt.
To fix:

  1. File -> Project Structure (or Cmd + ;)
  2. Modules on left hand side
  3. Properties tab
  4. Change "Compile Sdk Version" to a different one

For me, changing this made all the errors disappear.

Upvotes: 4

MattiahIT
MattiahIT

Reputation: 87

OK I have already fixed this issue. I had unninstalled AndroidStudio, deleted all folders related to IDE and also deleted SDK folder, after that installed everything fresh once again. That was very strange, that was the first time for me when Update broke IDE... Thank You all of You :)

Upvotes: 0

Peter
Peter

Reputation: 5164

This error indicates that expected imports aren't available on the classpath for what ever reason:

enter image description here

One cause could be that the InelliJ IDEA cache got messed up. Solution: Go to File->Invalidate Caches / Restart and check if the problem has been solved after restart.

Other cause could be that you deleted your SDK. Check if your Android-SDK ist still configured properly:

enter image description here

Let me know, if I helped you!

Upvotes: 0

Related Questions