ComponentProcessingStep was unable to process ‘com.example.hit.init.MyApplication_HiltComponents.Si
Posted 安果移不动
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ComponentProcessingStep was unable to process ‘com.example.hit.init.MyApplication_HiltComponents.Si相关的知识,希望对你有一定的参考价值。
implementation "com.google.dagger:hilt-android:2.43.2"
kapt "com.google.dagger:hilt-android-compiler:2.43.2"
implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03"
kapt 'androidx.hilt:hilt-compiler:1.0.0'
ComponentProcessingStep was unable to process 'com.example.hit.init.MyApplication_HiltComponents.SingletonC' because 'dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory' could not be resolved.
Dependency trace:
=> element (CLASS): androidx.hilt.lifecycle.ViewModelFactoryModules.ActivityModule
=> element (METHOD): provideFactory(android.app.Activity,android.app.Application,java.util.Map<java.lang.String,javax.inject.Provider<androidx.hilt.lifecycle.ViewModelAssistedFactory<? extends androidx.lifecycle.ViewModel>>>)
=> annotation: @dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory
=> type (ERROR annotation type): dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory
If type 'dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory' is on your classpath.
����: ComponentProcessingStep was unable to process 'com.example.hit.init.MyApplication_HiltComponents.ActivityRetainedC' because 'dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory' could not be resolved.
Dependency trace:
=> element (CLASS): androidx.hilt.lifecycle.ViewModelFactoryModules.ActivityModule
=> element (METHOD): provideFactory(android.app.Activity,android.app.Application,java.util.Map<java.lang.String,javax.inject.Provider<androidx.hilt.lifecycle.ViewModelAssistedFactory<? extends androidx.lifecycle.ViewModel>>>)
=> annotation: @dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory
=> type (ERROR annotation type): dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory
If type 'dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory' is on your classpath.
����: ComponentProcessingStep was unable to process 'com.example.hit.init.MyApplication_HiltComponents.ActivityC' because 'dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory' could not be resolved.
Dependency trace:
=> element (CLASS): androidx.hilt.lifecycle.ViewModelFactoryModules.ActivityModule
=> element (METHOD): provideFactory(android.app.Activity,android.app.Application,java.util.Map<java.lang.String,javax.inject.Provider<androidx.hilt.lifecycle.ViewModelAssistedFactory<? extends androidx.lifecycle.ViewModel>>>)
=> annotation: @dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory
=> type (ERROR annotation type): dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory
If type 'dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory' is on your classpath.
����: ComponentProcessingStep was unable to process 'com.example.hit.init.MyApplication_HiltComponents.FragmentC' because 'dagger.hilt.android.internal.lifecycle.DefaultFragmentViewModelFactory' could not be resolved.
Dependency trace:
=> element (CLASS): androidx.hilt.lifecycle.ViewModelFactoryModules.FragmentModule
=> element (METHOD): provideFactory(androidx.fragment.app.Fragment,android.app.Application,java.util.Map<java.lang.String,javax.inject.Provider<androidx.hilt.lifecycle.ViewModelAssistedFactory<? extends androidx.lifecycle.ViewModel>>>)
=> annotation: @dagger.hilt.android.internal.lifecycle.DefaultFragmentViewModelFactory
=> type (ERROR annotation type): dagger.hilt.android.internal.lifecycle.DefaultFragmentViewModelFactory
If type 'dagger.hilt.android.internal.lifecycle.DefaultFragmentViewModelFactory' is a generated type, check above for compilation errors that may have prevented the type from being generated. Otherwise, ensure that type 'dagger.hilt.android.internal.lifecycle.DefaultFragmentViewModelFactory' is on your classpath.
4 ������
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:hiltJavaCompileDebug'.
> Compilation failed; see the compiler error output for details.
删除下面这俩就行了
implementation "androidx.hilt:hilt-lifecycle-viewmodel:1.0.0-alpha03"
kapt 'androidx.hilt:hilt-compiler:1.0.0'
以上是关于ComponentProcessingStep was unable to process ‘com.example.hit.init.MyApplication_HiltComponents.Si的主要内容,如果未能解决你的问题,请参考以下文章