我有谷歌这个问题,但结果对我不起作用。
详情如下。
public final class App extends com.zhixin.wedeep.common.BaseApplication implements androidx.lifecycle.LifecycleOwner {
^
// Expected @HiltAndroidApp to have a value. Did you forget to apply the Gradle Plugin?
应用程序代码。
@HiltAndroidApp
class App : BaseApplication(), LifecycleOwner {
@Inject
lateinit var service: EventService
private val mLifecycleRegistry = LifecycleRegistry(this)
}
此模块 gradle 文件。
apply plugin: 'kotlin-kapt'
apply plugin: 'kotlin-allopen'
apply plugin: 'androidx.navigation.safeargs.kotlin'
apply plugin: 'dagger.hilt.android.plugin'
dependencies {
implementation rootProject.ext.dependencies["hilt-android"]
implementation rootProject.ext.dependencies["hilt-lifecycle-viewmodel"]
kapt rootProject.ext.kapt["hilt-compiler"]
kapt rootProject.ext.kapt["hilt-android-compiler"]
}
谁有想法?谢谢!