我现在正在用Kotlin开发一个Android应用程序,但是发生了一个错误:CompilationException:无法将方法调用“readText”内联到

我现在正在学习kotlin,但是当我尝试使用它来进行网络请求时,AndroidStudio在我的代码中抛出了一个exception。

public class CustomRequest(val city_code:String){ fun execute():ForecastResult{ val url = URL(SERVER+PARAM) val forecastResStr = url.readText() Log.e("MyApplication",forecastResStr) return JSON.parseObject(forecastResStr,ForecastResult::class.java) } } 

现在我不能编译我的应用程序,请help.Thanks。

这里是个例外:

 Error:(18, 59) org.jetbrains.kotlin.codegen.CompilationException: Back-end (JVM) Internal error: Couldn't inline method call 'readText' into fun execute():DataResult{ val resultStr = URL (COMPLETE_URL+city_code).readText() return JSON.parseObject(resultStr,SomeClass::class.java) } cause: Not generated Cause: List has more than one element. File being compiled and position: (18,59) in D:/WorkSpaces/asWorkSpace/xxx/xxx/x/DataResult.kt PsiElement: readText() The root cause was thrown at: _Collections.kt:473