Hi, I wonder if we can have Composable Function in...
# compose
e
Hi, I wonder if we can have Composable Function in created in another library and use it from the MainApp? When I did that, and as I access the composable function, it crashes. Maybe I miss out some step needed to setup the library? I have reported this issue on StackOverflow too with the design replicating the issue. https://stackoverflow.com/questions/68816470/for-jetpackcompose-can-we-create-our-composable-function-in-another-library
s
Make sure you have compiler plugin applied to both modules, it looks like one of them is not transforming the function calls :)
🙏 2
c
I wonder whether there is some gradle config (custom plugin or some
subprojects{}
incantation) that one can use such that all modules that use compose get the correct configuration
e
You’re right @shikasd, after adding
Copy code
kotlinOptions {
        jvmTarget = '1.8'
        useIR = true
    }
    buildFeatures {
        compose true
    }
    composeOptions {
        kotlinCompilerExtensionVersion compose_version
        kotlinCompilerVersion '1.5.10'
    }
all works! Thanks!!
a
c
@Albert Chang Thanks this is exactly what I was looking for