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

Unresolved reference: getBrowserIntent #265

Closed hamedsilver closed 1 year ago

hamedsilver commented 2 years ago

I'am adding showkase-processor with KSP but get Unresolved reference: getBrowserIntent

I'm using Showkase In multi module way:

app module:

ui_core module(android Library module): contain Compose components and Theme

in both module I added the show Case dependencies I check the generated file's in app module and find RootModuleShowkaseExtensionFunctionsCodegen

I used the implementation of the function directly inn my code for starting the Activity and it works.

val intent = Intent(context, ShowkaseBrowserActivity::class.java)
intent.putExtra("SHOWKASE_ROOT_MODULE", "com.mydigipay.designsystem.RootModule")
zaaaach commented 1 year ago

I am getting the exact same thing using KSP.

vinaygaba commented 1 year ago

Are you trying to reference the getBrowserIntent in the same module that you declared the @ShowkaseRoot class in?

@ShowkaseRoot
class MyRootModule: ShowkaseRootModule
zaaaach commented 1 year ago

Are you trying to reference the getBrowserIntent in the same module that you declared the @ShowkaseRoot class in?

@ShowkaseRoot
class MyRootModule: ShowkaseRootModule

Yes. I added an identical RootModule.kt as in the sample. I can also see the code is being generated in the build folder and getBrowserIntent exists.

vinaygaba commented 1 year ago

If the file is correctly generated with the getBrowserIntent, there's no reason for you to not be able to access it, unless you are trying to access it from a different package. Can you show me what the generated file that contains the getBrowserIntent looks like?

zaaaach commented 1 year ago

Yeah, it looks like because I had put the activity I was trying to access getBrowserIntent in a different package, but the same module. Didn't realize it was that granular.

vinaygaba commented 1 year ago

@zaaaach seems like you've identified the root cause and were able to resolve it so I'll go ahead and close this issue