KSP NoSuchMethodError when using Room 2.7.0
I'm getting following exception after updating Room from 2.6.1 to 2.7.0. Looks like XAnnotationBox API has been removed https://issuetracker.google.com/issues/392989692
Room 2.7.0-rc02 DeepLinkDispatch 6.2.2 Kotlin 2.1.10 KSP 2.1.10-1.0.29
[ksp] NoSuchMethodError: 'androidx.room.compiler.processing.XAnnotationBox androidx.room.compiler.processing.XElement.getAnnotation(kotlin.reflect.KClass)'
java.lang.NoSuchMethodError: 'androidx.room.compiler.processing.XAnnotationBox androidx.room.compiler.processing.XElement.getAnnotation(kotlin.reflect.KClass)'
at com.airbnb.deeplinkdispatch.DeepLinkProcessor.getAllUrisForAnnotatedElement(DeepLinkProcessor.kt:258)
at com.airbnb.deeplinkdispatch.DeepLinkProcessor.mapUrisToDeepLinkAnnotatedElement(DeepLinkProcessor.kt:218)
at com.airbnb.deeplinkdispatch.DeepLinkProcessor.collectDeepLinkElements(DeepLinkProcessor.kt:209)
at com.airbnb.deeplinkdispatch.DeepLinkProcessor.process(DeepLinkProcessor.kt:170)
at com.airbnb.deeplinkdispatch.BaseProcessor.process(BaseProcessor.kt:54)
at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:320)
at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:318)
at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.handleException(KotlinSymbolProcessingExtension.kt:430)
at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:318)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:112)
at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:75)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze$lambda$9(KotlinToJVMBytecodeCompiler.kt:356)
at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:112)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:347)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.runFrontendAndGenerateIrUsingClassicFrontend(KotlinToJVMBytecodeCompiler.kt:177)
at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:102)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:169)
at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:43)
at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:102)
at org.jetbrains.kotlin.cli.common.CLICompiler.exec(CLICompiler.kt:316)
at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1706)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(Unknown Source)
at java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source)
at java.rmi/sun.rmi.transport.Transport$1.run(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.rmi/sun.rmi.transport.Transport.serviceCall(Unknown Source)
at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(Unknown Source)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(Unknown Source)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(Unknown Source)
at java.base/java.security.AccessController.doPrivileged(Unknown Source)
at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
+1
We are also experiencing it.
Most likely that there is an incompatibility with the version of room and the xpreocessing version it is using and the one that is used by deep link dispatch. We will work on it once we update to that room version. But I cannot promise any timelines. Happy to take a contribution through.
+1
Same here.
And seems DeepLinkDispatch 6.2.2 doesn't support ksp2 (i think it's because room version):
[ksp] KaInvalidLifetimeOwnerAccessException: Access to invalid ksp.org.jetbrains.kotlin.analysis.api.platform.lifetime.KotlinAlwaysAccessibleLifetimeToken@58fb766e: PSI has changed since creation
+1
Same here.
+1
Same here.
+1
Same here.
While waiting for the fix from this team, you guys may use my fork to use if you need the compatibility with Room 2.7.2
settings.gradle.kts
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
// your configs
maven("https://raw.githubusercontent.com/toantk238/DeepLinkDispatch/maven2/maven-repo")
}
}
libs.toml
airbnbDeepLink = "6.3.0-SNAPSHOT"
airbnbDeepLink-core = { group = "com.airbnb", name = "deeplinkdispatch", version.ref = "airbnbDeepLink" }
airbnbDeepLink-base = { group = "com.airbnb", name = "deeplinkdispatch-base", version.ref = "airbnbDeepLink" }
airbnbDeepLink-processor = { group = "com.airbnb", name = "deeplinkdispatch-processor", version.ref = "airbnbDeepLink" }
@rock-tran if you got it working why not make a PR for this repo?