Giter Site home page Giter Site logo

Comments (13)

vinaygaba avatar vinaygaba commented on May 22, 2024

Does this module have the compose dependencies set up? It looks like you might not have the compose dependencies in the new module where you moved this root to.

from showkase.

vinaygaba avatar vinaygaba commented on May 22, 2024

Wanted to check again and see if you were able to resolve this issue with what I recommended

from showkase.

davidvavra avatar davidvavra commented on May 22, 2024

I didn't get to it yet. But the 'app' module doesn't have Compose dependencies, so it's most likely the cause.

from showkase.

vinaygaba avatar vinaygaba commented on May 22, 2024

Yeah that checks out as that's what the stack trace was pointing to as well.

from showkase.

davidvavra avatar davidvavra commented on May 22, 2024

Hi @vinaygaba. I have added compose dependencies to the app module and the error is gone and I can build the project.

However when I start the ShowKase activity, it crashes with this exception:

    java.lang.NoSuchMethodError: No direct method <init>(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function0;Ljava/lang/String;ZLjava/lang/Integer;Ljava/lang/Integer;ILkotlin/jvm/internal/DefaultConstructorMarker;)V in class Lcom/airbnb/android/showkase/models/ShowkaseBrowserComponent; or its super classes (declaration of 'com.airbnb.android.showkase.models.ShowkaseBrowserComponent' appears in /data/app/com.jll.mya.dev-IRMZ1MPZPHA3rYtalM9CxA==/base.apk!classes13.dex)
        at com.jll.jet.app.showkase.ShowKaseSetupCodegen.<init>(ShowKaseSetupCodegen.kt:41)
        at java.lang.Class.newInstance(Native Method)
        at com.airbnb.android.showkase.ui.ShowkaseBrowserActivity.getShowkaseProviderElements(ShowkaseBrowserActivity.kt:61)
        at com.airbnb.android.showkase.ui.ShowkaseBrowserActivity.access$getShowkaseProviderElements(ShowkaseBrowserActivity.kt:19)
        at com.airbnb.android.showkase.ui.ShowkaseBrowserActivity$onCreate$1.invoke(ShowkaseBrowserActivity.kt:31)
        at com.airbnb.android.showkase.ui.ShowkaseBrowserActivity$onCreate$1.invoke(ShowkaseBrowserActivity.kt:26)

Any ideas?

from showkase.

davidvavra avatar davidvavra commented on May 22, 2024

Any updates @vinaygaba? It's currently blocking usage of the library and I don't know how to proceed (only to for library and modify it somehow). I promise that if this is solved, I will write a blogpost a promote this library :)

from showkase.

vinaygaba avatar vinaygaba commented on May 22, 2024

@davidvavra I was on vacation, sorry about th delay! These kind of errors are usually when you are using a different version of kotlin/Compose than what the library is using. Could you tell me which version of compose you are trying it with?

from showkase.

vinaygaba avatar vinaygaba commented on May 22, 2024

This library is using 1.0.3. I can probably publish the library with the latest version if compose of that helps. Unfortunately this is a Compose related nuance as they build against specific versions of Kotlin

from showkase.

davidvavra avatar davidvavra commented on May 22, 2024

I checked and we are using same versions - Compose 1.0.3 and Kotlin 1.5.30. It was working when the root module was a nested module and not 'app' module, so I think the problem is somewhere else.

from showkase.

davidvavra avatar davidvavra commented on May 22, 2024

@vinaygaba I spent hours debugging dependencies and then I found out this was missing:

buildFeatures {
        compose = true
}

🤦‍♂️

So the issues is solved, but I think documentation should be improved (with dependency requirements for root module).

from showkase.

vinaygaba avatar vinaygaba commented on May 22, 2024

This is actually a compose requirement and has very little to do with Showkase. Since it's a Jetpack Compose only library, the assumption is that Compose is setup to work correctly in your codebase.

from showkase.

davidvavra avatar davidvavra commented on May 22, 2024

Our case is that all UI is in feature modules and those modules have correct Compose dependencies. We try to keep app module minimalistic, just Application object and necessary library setup. There is no UI so no Compose dependencies. But the app module is the only one with dependencies to all feature modules, so it needs to be root module for Showkase. And it wasn't obvious to me it also needs all the Compose setup.

from showkase.

vinaygaba avatar vinaygaba commented on May 22, 2024

Sounds like I can maybe add this detail in the setup to be explicit that Compose dependencies were needed. I'm glad it resolved for you though! Excited for you to try it out :)

from showkase.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.