ComponentProcessingStep was unable to process '*Application_HiltComponents.SingletonC'
See original GitHub issueBuild failed from version 2.41, can reproduce this issue on https://github.com/Goooler/DemoApp/pull/31.
> Task :app:hiltJavaCompileDailyDebug FAILED
error: ComponentProcessingStep was unable to process 'io.goooler.demoapp.DemoApplication_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.
error: ComponentProcessingStep was unable to process 'io.goooler.demoapp.DemoApplication_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.
error: ComponentProcessingStep was unable to process 'io.goooler.demoapp.DemoApplication_HiltComponents.ActivityC' because 'dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory' could not be resolved.
ComponentProcessingStep was unable to process 'io.goooler.demoapp.DemoApplication_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.
error: ComponentProcessingStep was unable to process 'io.goooler.demoapp.DemoApplication_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 errors
0 problems were found storing the configuration cache.
See the complete report at file:///Users/snebula/StudioProjects/DemoApp/build/reports/configuration-cache/popabyj1ftkzyogj54f7jaoh/bmgev1gjstvd3t2dbnqaodwzu/configuration-cache-report.html
ComponentProcessingStep was unable to process 'io.goooler.demoapp.DemoApplication_HiltComponents.ActivityRetainedC' because 'dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory' could not be resolved.
ComponentProcessingStep was unable to process 'io.goooler.demoapp.DemoApplication_HiltComponents.ActivityC' because 'dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory' could not be resolved.
ComponentProcessingStep was unable to process 'io.goooler.demoapp.DemoApplication_HiltComponents.FragmentC' because 'dagger.hilt.android.internal.lifecycle.DefaultFragmentViewModelFactory' could not be resolved.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:6
Top Results From Across the Web
Android Dagger2 ComponentProcessor was unable to process
Based on Google documentation you can do this: 1- Add @HiltViewModel annotation to the class. 2- Replace the @ViewModelInject annotation on ...
Read more >error ComponentProcessingStep was unable to process com ...
error: ComponentProcessingStep was unable to process 'com.ibot.cyrano.android.CyranoApplication_HiltComponents.SingletonC' because ...
Read more >Error: ComponentProcessingStep was unable to process ...
Error: ComponentProcessingStep was unable to process 'com.example.eg.AppApplication_HiltComponents.SingletonC' because 'dagger.hilt.android.
Read more >Dagger Hilt in Android with Example - GeeksforGeeks
So, to overcome this problem Hilt was introduced. Dagger Hilt simplifies the whole process and reduces the unnecessary steps without losing any ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Removing the dependency on hilt-lifecycle-viewmodel causes the error to go away as it is no longer required in newer versions of hilt. Simply delete this line from your app level build.gradle file if you have it.
implementation ‘androidx.hilt:hilt-lifecycle-viewmodel:x.x.x’
Hmm, the
androidx.hilt:hilt-lifecycle-viewmodel
artifacts were deprecated in the Dagger 2.34 release in favor of native Hilt API. The missingDefaultActivityViewModelFactory
class is no longer in the Hilt codebase.You should be able to fix this using the instructions in the 2.34 release notes to upgrade to the new
HiltViewModel
API.