Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannont resolve symbol JSONObject (Android Studio)

I have spent two days in this. I can work with other PC, but my Android Studio doesn´t import the library, I took two captures:

As yo can see in the first picture, Android Studio autocompletes my line:

Autocompleted

However:

ERROR

I was reading about JSONObject in Android Developers (here) and Android include this in library. I also have tried to import other libraries from "org", but just works fine two of them:

Problems org

Them... I was thinking this might be a problem of Android Studio, and I reinstalled the IDE, the error persists.

And I have tried to import the library in the gradle (this is in build.gradle module: app):

enter image description here

I was working with other PC, it works well, but I need to fix this in my computer.

Please, any help will be grateful.

like image 937
BigBugCreator Avatar asked Apr 28 '15 10:04

BigBugCreator


1 Answers

I´ll respond to the future, if someone has the same error:

I did this (Thaks to Bigdestroyer):

File -> Invalidate caches/Restart -> Invalidate and Restart 

You can try to delete ~/.gradle/caches directory to force re-download the dependencies.

Now its works perfect. Thanks !!!!

like image 192
BigBugCreator Avatar answered Oct 06 '22 21:10

BigBugCreator