아주 오래된 프로젝트를 재구축하려면
hilt와 관련하여 다음과 같은 오류 로그가 표시됩니다.
이것은 조각에서 발생하는 오류입니다.
Hilt 관련 설정에는 문제가 없으며,
@AndroidEntryPoint를 추가하는 것과 같은 기본적인 작업도 잘 작동합니다.
public abstract static class FragmentC
implements TestFragment_GeneratedInjector,
^
symbol: class TestFragment_GeneratedInjector
location: class MyApplication_HiltComponents
error: ComponentProcessingStep was unable to process
'com.exam.test.MtApplication_HiltComponents.FragmentC'
because 'TestFragment_GeneratedInjector' could not be resolved.
Dependency trace:
=> element (CLASS): com.exam.test.MyApplication_HiltComponents.FragmentC
=> type (ERROR interface): TestFragment_GeneratedInjector
If type 'TestFragment_GeneratedInjector' is a generated type,
check above for compilation errors
that may have prevented the type from being generated.
Otherwise, ensure that type 'TestFragment_GeneratedInjector' is on your classpath.
2 errors
ComponentProcessingStep was unable to process
'com.exam.test.MyApplication_HiltComponents.FragmentC'
because 'TestFragment_GeneratedInjector' could not be resolved.
알고 보니 문제는 파일 맨 위에 써야 할 패키지 이름이 없다는 것이었다.
패키지 이름을 다시 적어보니 빌드에는 문제가 없었습니다.
오래된 파일이라 패키지 이름을 왜 줄였는지는 기억이 안나지만,
hilt가 적용된 상태에서 새 파일로 리팩토링을 하면 없어졌을 수도 있을 것 같아요.
앞으로 비슷한 문제가 발생하지 않도록 이것을 기록하고 있습니다.