728x90 android hilt context1 [안드로이드] Hilt 의존성 주입 - "error: [Dagger/MissingBinding] android.content.Context cannot be provided without an @Provides-annotated method." 에러 해결방법 Hilt를 사용하지 않았던 프로젝트에서 ViewModel과 Repository에 Hilt 의존성을 주입하던 중 오류가 발생했습니다. "error: [Dagger/MissingBinding] android.content.Context cannot be provided without an @Provides-annotated method." 오류 메시지의 의미대로 Context를 사용하는 곳에 어노테이션을 추가하지 않아서 발생하는 오류(?)라고 생각이 들어 얼른 구글링을 했습니다. DataStore에 접근하기 위해 Repository에 매개변수로 Context를 전달받고 있습니다. 이때, @ApplicationContext 키워드를 추가하지 않아 발생하던 오류였습니다!! 2023. 5. 14. 이전 1 다음 728x90 반응형