Problems encountered using kotlin and Retrofit?

No type arguments expected for class Observable problem solution?

First of all, the dependencies I use are as follows:

//后期使用retrofit网络访问框架
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
//转换json  挂代理的小心,即使关闭代理可能也会报错。关闭代理后重启AS,估计是AS3.0的bug
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.0.1'
implementation 'io.reactivex:rxandroid:1.1.0'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.1.2'//日志

then found mine

Location
An error is reported and cannot be used. It turns out that the imported package is on a business trip.

Just delete and modify the new package, as follows:
that's it

Thank you, this is really the problem I encountered. It is estimated that many friends who are exposed to kotlin+retrofit will encounter this problem.

Guess you like

Origin blog.csdn.net/mawlAndroid/article/details/124192198