I used libgdx to build my project and I am having issues using the JSONObject class. When I add import org.json.JSONObject
, it says it cannot resolve. How do I add that library to my project?
Here is what I have tried without success:
- I downloaded the
json-simple-1.1.jar
and put it in core/build/libs folder. Could not useimport.org.json.simple.JSONObject
either. - When browsing the tree in Android Studio as "Packages" dropdown, I can see the classes I want under
"Core -> Libraries -> org -> json"
but I cannot add them to my project. I get a "cannot refractor, class is in a jar file" error.
Is there something I have not tried yet to solve this issue? I feel I will run into this again as I try to use other external libraries.
Thank you.