【问题标题】:Retrofit cannot be resolved with Gradle 3.1.2Gradle 3.1.2 无法解决改造问题
【发布时间】:2018-05-04 07:41:55
【问题描述】:

从 Gradle 2.x.x 升级到 Gradle 版本 3.1.2 后,retrofit2.Callback 无法解决。我在这样添加的子模块中使用 Retrofit:

api project(path: ':sdk', configuration: 'default')

sdk中的retrofit依赖是这样添加的:

api "com.squareup.retrofit2:retrofit:2.4.0"

我的错误信息是:

Supertypes of the following classes cannot be resolved. Please make sure you have the required dependencies in the classpath: class ***, unresolved supertypes: retrofit2.Callback

IDE 没有向我显示类中的问题,即回调以某种方式丢失。 Android Studio 版本为 3.1.2。

到目前为止我尝试了什么:

  • 清理 Gradle 缓存
  • 项目的干净构建
  • 将 Kotlin 更新到 1.2.41

【问题讨论】:

标签: android gradle kotlin retrofit retrofit2


【解决方案1】:

我通过在 Preferences -> Build, Execution, Deployment -> Instant Run 上禁用“Instant Run”解决了这个问题。

【讨论】:

    猜你喜欢
    • 2017-04-10
    • 2015-11-14
    • 1970-01-01
    • 1970-01-01
    • 2018-11-07
    • 1970-01-01
    • 2018-11-08
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多