Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Showkase was not able to find the root class that youpassed to @ShowkaseScreenshot #212

Closed
zoey-juan opened this issue Jan 18, 2022 · 6 comments

Comments

@zoey-juan
Copy link

zoey-juan commented Jan 18, 2022

Hi!
I am trying to integrate the screenshot test but always getting Showkase was not able to find the root class that youpassed to @ShowkaseScreenshot. Not sure if I missed some configuration, could you please give me some hints? :)

./gradlew xxx-compose-app:runDebugAndroidTestScreenshotTest

dependencies {
    ...
    implementation(Libs.showkase)
    ksp(Libs.showkase_processor)
    androidTestImplementation("com.facebook.testing.screenshot:core:0.13.0")
    androidTestImplementation("com.airbnb.android:showkase-screenshot-testing:1.0.0-beta10")
    kaptAndroidTest("com.airbnb.android:showkase-processor:1.0.0-beta10")
}
@ShowkaseRoot
class RootModule : ShowkaseRootModule
@ShowkaseScreenshot(rootShowkaseClass = RootModule::class)
abstract class ComposeTests : ShowkaseScreenshotTest {

    override fun onScreenshot(
        id: String,
        name: String,
        group: String,
        styleName: String?,
        screenshotType: ShowkaseScreenshotType,
        screenshotBitmap: Bitmap
    ) { .....
    }
}
e: [ksp] com.airbnb.android.showkase.processor.exceptions.ShowkaseProcessorException: Showkase was not able to find the root class that youpassed to @ShowkaseScreenshot. Make sure that you have configured Showkase correctly.
        at com.airbnb.android.showkase.processor.ShowkaseProcessor.writeScreenshotTestFiles(ShowkaseProcessor.kt:291)
        at com.airbnb.android.showkase.processor.ShowkaseProcessor.processShowkaseMetadata(ShowkaseProcessor.kt:198)
        at com.airbnb.android.showkase.processor.ShowkaseProcessor.process(ShowkaseProcessor.kt:61)
        at com.airbnb.android.showkase.processor.BaseProcessor.internalProcess(BaseProcessor.kt:96)
        at com.airbnb.android.showkase.processor.BaseProcessor.process(BaseProcessor.kt:81)
        at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$4$1.invoke(KotlinSymbolProcessingExtension.kt:169)
        at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension$doAnalysis$4$1.invoke(KotlinSymbolProcessingExtension.kt:168)
        at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.handleException(KotlinSymbolProcessingExtension.kt:246)
        at com.google.devtools.ksp.AbstractKotlinSymbolProcessingExtension.doAnalysis(KotlinSymbolProcessingExtension.kt:168)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration(TopDownAnalyzerFacadeForJVM.kt:120)
        at org.jetbrains.kotlin.cli.jvm.compiler.TopDownAnalyzerFacadeForJVM.analyzeFilesWithJavaIntegration$default(TopDownAnalyzerFacadeForJVM.kt:86)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:540)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler$analyze$1.invoke(KotlinToJVMBytecodeCompiler.kt:531)
        at org.jetbrains.kotlin.cli.common.messages.AnalyzerWithCompilerReport.analyzeAndReport(AnalyzerWithCompilerReport.kt:113)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.analyze(KotlinToJVMBytecodeCompiler.kt:531)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli(KotlinToJVMBytecodeCompiler.kt:188)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinToJVMBytecodeCompiler.compileModules$cli$default(KotlinToJVMBytecodeCompiler.kt:154)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:169)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:90)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
        at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
        at org.jetbrains.kotlin.daemon.CompileServiceImpl.compile(CompileServiceImpl.kt:1575)
        at jdk.internal.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at java.rmi/sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:359)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:200)
        at java.rmi/sun.rmi.transport.Transport$1.run(Transport.java:197)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.rmi/sun.rmi.transport.Transport.serviceCall(Transport.java:196)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:562)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:796)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$0(TCPTransport.java:677)
        at java.base/java.security.AccessController.doPrivileged(Native Method)
        at java.rmi/sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:676)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:834)
@zoey-juan
Copy link
Author

use 1.0.0-beta08 works

@lpappalettera
Copy link

Same here, only 1.0.0-beta08 seems to work.

@vinaygaba
Copy link
Collaborator

I merged a PR that fixes the multi module issue that some folks reported - #216. That seems to be the main issue in the releases after beta08.

However, I think this issue is something else. In the code you shared above you are using ksp for the processor but the androidTest is using kapt. This is most likely the issue.

ksp(Libs.showkase_processor)
kaptAndroidTest("com.airbnb.android:showkase-processor:1.0.0-beta10")

Can you replace it with this instead and report back on whether it's working or not.

ksp(Libs.showkase_processor)
kspAndroidTest project("com.airbnb.android:showkase-processor:1.0.0-beta10")

@davidvavra
Copy link

Hi I just updated to beta11 and I'm having the same problem.

I can replicate this issue in my open-source version, so it should be easier to debug.

Repro steps:

  1. Check out this branch: https://github.com/davidvavra/showkase-screenshot-tests/tree/beta11
  2. Run ./gradlew assembleDebugAndroidTest

@vinaygaba
Copy link
Collaborator

@davidvavra Fantastic! thanks for sharing!

@vinaygaba
Copy link
Collaborator

Alright I have a fix up!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants