Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使Kotlin Fuel json序列化程序编译?_Kotlin_Fuel - Fatal编程技术网

如何使Kotlin Fuel json序列化程序编译?

如何使Kotlin Fuel json序列化程序编译?,kotlin,fuel,Kotlin,Fuel,我正在尝试使用,因此我将其添加到我的依赖项中,如下所示: implementation 'com.github.kittinunf.fuel:fuel:2.2.1' implementation 'com.github.kittinunf.fuel:fuel-json:2.2.1' 但是,每次运行/gradlew clean build时,我都会遇到以下错误: > Task :compileKotlin FAILED e: /DirToMyClass/MyClass.kt: (55, 2

我正在尝试使用,因此我将其添加到我的依赖项中,如下所示:

implementation 'com.github.kittinunf.fuel:fuel:2.2.1'
implementation 'com.github.kittinunf.fuel:fuel-json:2.2.1'
但是,每次运行
/gradlew clean build
时,我都会遇到以下错误:

> Task :compileKotlin FAILED
e: /DirToMyClass/MyClass.kt: (55, 26): Cannot access class 'org.json.JSONObject'. Check your module classpath for missing or conflicting dependencies
我已经运行了
/gradlew dependencies
来检查是否没有其他依赖项导入
org.json
,只有
fuel json

+--- com.github.kittinunf.fuel:fuel-json:2.2.1
|    +--- com.github.kittinunf.fuel:fuel:2.2.1 (*)
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.3.60 (*)
|    \--- org.json:json:20180813

我可以缺少什么?

我通过将依赖项更改为:

implementation 'com.github.kittinunf.fuel:fuel:2.2.1'
implementation('com.github.kittinunf.fuel:fuel-json:2.2.1') {
    exclude group: 'org.json', module: 'json'
}

implementation 'org.json:json:20190722'
使用较新版本的
org.json:json

+--- com.github.kittinunf.fuel:fuel-json:2.2.1
|    +--- com.github.kittinunf.fuel:fuel:2.2.1 (*)
|    +--- org.jetbrains.kotlin:kotlin-stdlib:1.3.50 -> 1.3.60 (*)
|    \--- org.json:json:20180813