Open
Description
openedon Aug 19, 2024
When enabling ksp.useKSP2=true
in my gradle.properties
ksp fails for a module in my project. When removing ksp.useKSP2=true
, it works as expected.
> Task :navigation-android:kspReleaseKotlin FAILED
e: [ksp] dagger.internal.codegen.base.DaggerSuperficialValidation$ValidationException$UnexpectedException:
Validation trace:
=> element (OBJECT): handler.di.NavHandlersModule
=> element (METHOD): provideNavHandlers(java.util.Map<java.lang.Class<?>,handler.NavHandler<?>>)
=> element (PARAMETER): handlers
=> type (DECLARED parameter type): java.util.Map<java.lang.Class<?>,handler.NavHandler<?>>
=> type (DECLARED type argument): java.lang.Class<?>
NavHandlersModule.kt
@Module
@InstallIn(SingletonComponent::class)
object NavHandlersModule {
@Provides
@Singleton
fun provideNavHandlers(
handlers: @JvmSuppressWildcards Map<Class<*>, NavHandler<*>>
): NavHandlers {
return NavHandlers(handlers)
}
}
NavHandler.kt
abstract class NavHandler<B : NavBundle> {
abstract fun handle(bundle: B, host: NavHost, additionalHandlerParams: AdditionalHandlerParams)
}
NavBundle.kt
abstract class NavBundle
data object PhotoBundle : NavBundle()
@Module
@InstallIn(SingletonComponent::class)
interface PhotoNavHandlerModule {
@Binds
@IntoMap
@ClassKey(PhotoBundle::class)
fun bindPhotoNavHandler(it: PhotoNavHandler): NavHandler<*>
}
ksp version: 2.0.10-1.0.24
kotlin version: 2.0.10
Please let me know if there is any more info I can provide!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Metadata
Assignees
Labels
No labels