Hey everyone, I've used the Kotlin Multiplatform ...
# ballast
s
Hey everyone, I've used the Kotlin Multiplatform Wizard tool to generate a project with shared UI. I've noticed both the general project structure as the
build.gradle.kt
file are a bit different as opposed to prior KMM projects. And now when I try to add the ballast dependencies to my
commonMain.dependencies
definition, the retrieval for the iOS targets fails (in the past, defining an
ios()
was enough, now you need to be more specific e.g.
iosArm64
,
iosX64
, ...). When I move the dependencies to the
androidMain
section however, the retrieval succeeds. Is there something I'm missing in my gradle setup, or does the library need to define new target definitions to support these iOS sub-targets?
c
There shouldn’t be anything different with ios targets. Can you please share a sample project with demonstrating the issue, so I can look into it?
s
This project I made is basically just the result of using the Kotlin Multiplatform Wizard tool (https://kmp.jetbrains.com/) and checking the
Android
and
iOS - Share UI
option. This creates a Gradle project with support for Compose Multiplatform, and when I basically add the Ballast dependencies in the
commonMain
dependencies here, as derived from the README.md, the Gradle sync fails with several similar messages all complaining about the iOS subtargets (
iosX64()
,
iosArm64()
,
iosSimulatorArm64()
). I've been able to derive that the errors only occur on
io.github.copper-leaf:ballast-firebase-analytics
and
io.github.copper-leaf:ballast-firebase-crashlytics
. If I comment these 2 out, then the others do resolve without issue.
c
Ah got it, yes that makes sense. The firebase modules depend on the Android Firebase SDK, so they do not support any targets other than Android. The core functionality for those features is available in
ballast-analytics
and
ballast-crash-reporting
, but you’ll need to wire them up the platform’s reporting SDKs yourself. I see now that the docs are incorrect in showing the firebase-specific dependences in
commonMain
, so I will update that shortly
🙏 1
s
Ah, makes sense indeed; Thanks!