Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- DIABLO4
- 디버그
- 리소스 자동화
- 안드로이드 리소스
- Kulle
- gradle
- android resource automation
- 분류
- 9498
- Connectable Observable Operators
- Android Support Library
- MVP
- android weekly
- 백준
- 안드로이드
- JSON
- Season3
- RXjava
- AndroidWeek
- rxandroid
- RX
- parser
- Android
- retrolambda
- logansquare
- 구현
- ReactiveX
- 성공
- Observable
Archives
- Today
- Total
안드로이드 개발 팁 블로그
[Hilt,Dagger]cannot access DefaultActivityViewModelFactory 본문
336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
dagger 2.28에서 2.34 마이그레이션을 진행하던 중 아래와 같은 이슈가 발생하였다.
> Task :app:kaptDebugKotlin
error: cannot access DefaultActivityViewModelFactory
class file for dagger.hilt.android.internal.lifecycle.DefaultActivityViewModelFactory not found
Consult the following stack trace for details.
cannot access DefaultActivityViewModelFactory
해결방법은 @ViewModelInject 어노테이션이 deprecated되었기에 @HiltViewModel 변경하면 해결
You can find more details in the Dagger 2.34 release notes, and I've just updated the release notes with a section to help migration from @ViewModelInject to @HiltViewModel.
Migration steps:
Users of @ViewModelInject can migrate to @HiltViewModel which was added in Dagger 2.31.
- Add @HiltViewModel annotation to the class
- Replace the @ViewModelInject annotation on the constructor with @Inject.
- Remove @Assisted from the SavedStateHandle constructor parameter, if it exists
- Remove the old androidx.hilt:hilt-lifecycle-viewmodel dependency from your build.gradle file
Comments