airbnb / Showkase

🔦 Showkase is an annotation-processor based Android library that helps you organize, discover, search and visualize Jetpack Compose UI elements
https://medium.com/airbnb-engineering/introducing-showkase-a-library-to-organize-discover-and-visualize-your-jetpack-compose-elements-d5c34ef01095
Apache License 2.0
2.11k stars 107 forks source link

Incompatibility with Dagger 2.48 #349

Closed jd565 closed 1 year ago

jd565 commented 1 year ago

Dagger 2.48 released with alpha support for ksp. This is something that I think a lot of people are wanting to try.

When we updated, we get the following error from showkase:

java.lang.NoSuchMethodError: 'androidx.room.compiler.processing.XProcessingEnv androidx.room.compiler.processing.XProcessingEnv$Companion.create$default(androidx.room.compiler.processing.XProcessingEnv$Companion, java.util.Map, com.google.devtools.ksp.processing.Resolver, com.google.devtools.ksp.processing.CodeGenerator, com.google.devtools.ksp.processing.KSPLogger, androidx.room.compiler.processing.XProcessingEnvConfig, int, java.lang.Object)'
    at com.airbnb.android.showkase.processor.BaseProcessor.process(BaseProcessor.kt:75)
    at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:305)
    at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$8$1.invoke(KotlinSymbolProcessingExtension.kt:303)
    at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.handleException(KotlinSymbolProcessingExtension.kt:409)
    at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:303)
    at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:112)
    at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:88)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:256)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:42)
    at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:115)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:247)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:87)
    at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:47)
    at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:168)
    at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:53)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:100)
    at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:46)
    at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:101)
    at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1497)
    at jdk.internal.reflect.GeneratedMethodAccessor116.invoke(Unknown Source)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.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)

It looks like a dependency pulled in by dagger is a higher version than that used in showkase, which is causing this error. It also looks like a recent commit updated the XProcessing dependency which may solve this issue? Is there any chance of a new release or any instructions of how to get a showkase artifact based on this build?

We are currently using showkase 1.0.0-beta17 due to issues in 1.0.0-beta18 (that have also been fixed in the repository but not released).

elcolto commented 1 year ago

I can confirm this issue. The problem relies in the room compiler version https://github.com/airbnb/Showkase/blob/1.0.0-beta18/build.gradle#L36

It would be fixed with the current version on master (2.6.x)

A new release would be helpful

KennyGoers commented 1 year ago

Any timeframe on beta19 build? Also running into this issue.

vinaygaba commented 1 year ago

I'm doing a release in the next few hours. Have some minor changes to get in but I will be doing a release later today!

KennyGoers commented 1 year ago

🙏

KennyGoers commented 1 year ago

@vinaygaba IS this still happening? I don't mean to bother you, just need to know. Thanks.

vinaygaba commented 1 year ago

@KennyGoers Yes, I've been working on trying to get this PR merged - https://github.com/airbnb/Showkase/pull/353

I think I just got it to pass after some changes I made an hour ago.

vinaygaba commented 1 year ago

New release went out here - https://github.com/airbnb/Showkase/releases/tag/1.0.2