liujingxing / rxhttp

🔥🔥🔥 Based on OkHttp encapsulation, support Kotlin Coroutines、RxJava2、RxJava3; 30s to get started.
https://juejin.im/post/5ded221a518825125d14a1d4
Apache License 2.0
3.74k stars 457 forks source link

The variable 'DEV_URL' must be String #475

Closed fail572872916 closed 8 months ago

fail572872916 commented 8 months ago

如图错误 微信截图_20231220004354 配置如下

微信截图_20231220004319 微信截图_20231220004333 微信截图_20231220004429

如何解决问题

liujingxing commented 8 months ago

抱歉,没注意看邮件,麻烦提供下rxhttp及ksp版本号

liujingxing commented 8 months ago

为变量显示声明为String类型就可以了,原因是你用Java的String对象赋值给kotlin的变量,导致ksp无法推断出正确的类型,显示声明类型就好

fail572872916 commented 8 months ago

抱歉,没注意看邮件,麻烦提供下rxhttp及ksp版本号 ksp "com.github.liujingxing.rxhttp:rxhttp-compiler:3.0.5" api 'com.github.liujingxing.rxhttp:rxhttp:3.0.3'

fail572872916 commented 8 months ago

const val DEV_URL:String = BuildConfig.APP_BaseUrl 这样就可以了

liujingxing commented 8 months ago

是的,显示声明类型就好