android studio cannot resolve import org.json.JSONObject

前端 未结 1 1508
误落风尘
误落风尘 2021-01-17 13:00

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

相关标签:
1条回答
  • 2021-01-17 13:13

    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:<version>' 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'
    }
    
    0 讨论(0)
提交回复
热议问题