Adh*_*mal 25 android dagger-hilt
我刚刚更新我的Android希尔特匕首的依赖关系到1.0.0-alpha03
和我身材ApplicationComponent被弃用
,取而代之的
,但一旦我在我的代码替换它显示了这个错误我是否需要做别的任何事情,只是用它?SingletonComponent
完全错误
> Task :app:kaptDebugKotlin FAILED
error: [Hilt]
@DefineComponent dagger.hilt.components.SingletonComponent is missing a parent declaration.
Please declare the parent, for example: @DefineComponent(parent = ApplicationComponent.class)
[Hilt] Processing did not complete. See error above for details.error: [Hilt]
@DefineComponent dagger.hilt.components.SingletonComponent is missing a parent declaration.
Please declare the parent, for example: @DefineComponent(parent = ApplicationComponent.class)
[Hilt] Processing did not complete. See error above for details.error: [Hilt]
@DefineComponent dagger.hilt.components.SingletonComponent is missing a parent declaration.
Please declare the parent, for example: @DefineComponent(parent = ApplicationComponent.class)
[Hilt] Processing did not complete. See error above for details.error: [Hilt]
@DefineComponent dagger.hilt.components.SingletonComponent is missing a parent declaration.
[Hilt]
Please declare the parent, for example: @DefineComponent(parent = ApplicationComponent.class)
[Hilt] Processing did not complete. See error above for details.
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
Run Code Online (Sandbox Code Playgroud)
提前致谢。
mik*_*ack 38
尝试将您的 hilt-android-compiler 更新为
kapt "com.google.dagger:hilt-android-compiler:2.37"
您可以导入 SingleComponent 类,但 kapt 无法正确处理它。
刀柄版本和 kapt 版本匹配很重要。这是我目前的设置。
// HILT
def hilt_version = "2.37"
implementation "com.google.dagger:hilt-android:$hilt_version"
kapt "com.google.dagger:hilt-android-compiler:$hilt_version"
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3415 次 |
| 最近记录: |