Har*_*ali 8 android kotlin dagger dagger-hilt
我正在尝试升级旧版本项目以支持SDK 33并在编译时出现此错误。
error: ComponentProcessingStep was unable to process 'com.irokotv.dagger.AppComponent' because 'com.chuckerteam.chucker.api.ChuckerInterceptor' could not be resolved.
Dependency trace:
=> element (CLASS): com.irokotv.logic.dagger.ApiModule
=> element (METHOD): getClient(okhttp3.Interceptor,com.chuckerteam.chucker.api.ChuckerInterceptor)
=> type (EXECUTABLE method): (okhttp3.Interceptor,com.chuckerteam.chucker.api.ChuckerInterceptor)okhttp3.OkHttpClient
=> type (ERROR parameter type): com.chuckerteam.chucker.api.ChuckerInterceptor
If type 'com.chuckerteam.chucker.api.ChuckerInterceptor' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'com.chuckerteam.chucker.api.ChuckerInterceptor' is on your classpath.
Run Code Online (Sandbox Code Playgroud)
我已将 kotlin 更新1.3.72为1.7.10
dagger2.27为2.48
tools.build:gradle4.0.1为7.4.2
gradle-wrapper.properties6.5为7.6
我尝试过的:
在旧项目中与版本一起使用的块库
debugApi "com.readystatesoftware.chuck:library:1.1.0"
releaseApi "com.readystatesoftware.chuck:library-no-op:1.1.0"
Run Code Online (Sandbox Code Playgroud)
我尝试使用其中一种解决方案进行更改com.github.ChuckerTeam.Chucker,但它对我不起作用。该库的最新版本是,4.0.0但我无法升级到最新版本,因为它需要 kotlin1.8.0版本,并且该项目使用了 viewBinding,所以我无法将 kotlin 版本升级到最新版本。
debugImplementation "com.github.ChuckerTeam.Chucker:library:3.5.2"
releaseImplementation "com.github.ChuckerTeam.Chucker:library-no-op:3.5.2"
Run Code Online (Sandbox Code Playgroud)
现在我被版本困住了。问题似乎出在组件或模块连接或 gradle 版本中。我需要帮助。
小智 0
检查 Proguard/R8 规则: 如果您使用 Proguard 或 R8 进行代码混淆和缩减,请确保您有适当的规则来防止必要的类(包括“com.chuckerteam.chucker.api.ChuckerInterceptor”)被混淆或删除。
库兼容性: 确保您使用的 Chucker 库版本与您使用的 Dagger 版本兼容。检查项目依赖项之间是否存在兼容性或版本冲突。
更新 Dagger 配置: 如果您有提供“ChuckerInterceptor”的 AppModule 或 ApiModule,请确保您已使用@Provides或@Binds正确注释提供此拦截器的方法。验证您是否已将“com.chuckerteam.chucker.api.ChuckerInterceptor”包含在 Dagger 模块中提供的依赖项列表中。
| 归档时间: |
|
| 查看次数: |
988 次 |
| 最近记录: |