Claus Petersen
Claus Petersen

Reputation: 101

Android studio incompatible types required java.lang.String found java.lang.String

After updating my Android Studio and Java, I get the above error on a simple statement like:

String s = "";

It seems like Android Studio cant find my Java.

I use Gradle (from inside Android Studio) to build my project, on a Windows 7(64bit).

I also get this error:

  @Override, not applicable to method

on my methods using: @Override

You can check out the project on Github, it works on my other computers, but not my home computer.

Can anyone please help me

Upvotes: 10

Views: 4292

Answers (1)

Moystard
Moystard

Reputation: 1837

I know this is old but I got the same problem after my machine crashed while I was using Android Studio. The solution is quite simple, head to

File > Invalidate Caches & Restart

Your IDE will restart and your JAVA environment will be properly functional again.

Upvotes: 14

Related Questions