Hi, is it possible to include a KMM Library (targe...
# multiplatform
t
Hi, is it possible to include a KMM Library (target Android and iOS) into a plain Android Application using Gradle Composite Builds (using
includeBuild
)? If yes, are there any working examples?
1
s
It works. No public sample I can point you to from the top of my head. https://youtrack.jetbrains.com/issue/KTIJ-15769 is annoying, but in principle, everything works.
includeBuild("myLibrary")
in the app's
settings.gradle.kts
, and in
app/build.gradle.kts
then
implementation("maven.group:myLibrary")
That's with the library as a git-submodule in the app project, which is how we want it, so we can iterate fast.
t
Thanks, thats also the setup we strive for. having the KMM Library as git-submodule. i eventually got it working but i also experience the issue you described about classes not being recognized. i hope this will be fixed soon 🤞
u
using composite build, I connected an external KMM library to my Android Project, and I resolved an issue with unresolved classes by Android Studio / Intellij IDEA, see my comment https://youtrack.jetbrains.com/issue/KTIJ-20625#focus=Comments-27-5694073.0-0