Android Studio Arctic Fox 2020.3.1 이 정식버전으로 릴리즈됐다. 업데이트 하면서 Android Studio와 AGP(Android gradle plugin)의 버전 체계가 변경되었다. Android Studio는 그 기반인 IntelliJ IDEA에 맞춰 <IntelliJ년도>.<Major 버전>.<Minor 버전> 형태를 사용하고, AGP는 시멘틱 버전관리를 따르면서 필요로하는 gradle 버전을 따라가게 되었다. 이 버전에 대한 자세한 내용은 공식 블로그를 통해 살펴볼 수 있다.
문제는 자연스럽게 Android Studio를 업데이트 하고, gradle을 7.0으로 업데이트 한 후, 발생하는 에러였다.

에러 내용을 보면 다음과 같다.
Unable to find method ”void com.android.build.api.extension.AndroidComponentsExtension$DefaultImpls.androidTests$default(com.android.build.api.extension.AndroidComponentsExtension, com.android.build.api.extension.VariantSelector, kotlin.jvm.functions.Function1, int, java.lang.Object)”
‘void com.android.build.api.extension.AndroidComponentsExtension$DefaultImpls.androidTests$default(com.android.build.api.extension.AndroidComponentsExtension, com.android.build.api.extension.VariantSelector, kotlin.jvm.functions.Function1, int, java.lang.Object)’
이것만으로 원인을 알기는 힘들었는데, 구글링 결과 Hilt에서 문제가 발생한다고 한다. 해당 이슈는 Hilt 2.38.1에서 해결이 되었으며 Dagger의 릴리즈 노트에서 확인이 가능하다.
Hilt bug fixes
- Fix #2784. Fix an issue with AGP 7.0+ where the Gradle plugin bytecode transform was not applied to non-test code. This affected all
@AndroidEntryPoint
and@HiltAndroidApp
classes that did not directly themselves extend from the Hilt-generated base class and meant that Hilt was not actually applied to those classes. (666df50) - Fix #2762. Fix an incompatibility with AGP 7.0.0-beta05 and 7.0.0-rc01 (09087db)
해결책은 그러니까, Dagger-Hilt 버전을 2.38.1 이상으로 변경.