Using the [built-in Kotlin](https://developer.android.com/build/migrate-to-built-in-kotlin) and `legacy-kapt` in AGP 9 emit this error: ``` * Exception is: org.gradle.api.CircularReferenceException: Circular dependency between the following tasks: :midiroll-screen:kaptDebugKotlin +--- :midiroll-screen:kaptGenerateStubsDebugKotlin | \--- :midiroll-screen:kspDebugKotlin | \--- :midiroll-screen:kaptDebugKotlin (*) \--- :midiroll-screen:kspDebugKotlin (*) (*) - details omitted (listed previously) ``` Might be related with https://github.com/google/ksp/issues/1772 ## Tested Versions - 2.2.10-2.0.2 -> No issue - 2.3.4 -> Circula ref issue Here's a reproducer: https://github.com/esafirm/circular-ref-kapt-ksp