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 r
If you are using LibGdx, it does not come with a Gradle setup, making multi-project builds streamlined.
You need to add implementation 'org.json:json:
to the dependencies block of your top-level build.gradle
.
To find the latest version, see http://mvnrepository.com/artifact/org.json/json/
For example, using the latest version at the time of writing:
dependencies {
implementation 'org.json:json:20200518'
}