hi! i’m new to kotlin and KMM and i’m trying to cr...
# getting-started
s
hi! i’m new to kotlin and KMM and i’m trying to create a multiplatform app using this android library but i’m still confused about how to setup everything. i even opened up a stack overflow ticket about it but i’m still not clear about how it works? i’m supposed to add the dependency in the androidApp module and then create a common api in commonMain and then platform-specific code in iosMain and androidMain?
i
Not sure if that helps, but this is a fantastic starter project: https://github.com/touchlab/KaMPKit
1
e
I hope I am not confused you with my answer. Try to explain here, we can update my answer together and make it clear for others Your starter KMM application has 3 parts: •
androidApp/
- contains your Android application. It has starting point of your Android application •
iosApp/
- contains your iOS application. It has starting point of your iOS application •
shared/
- its just shared library which compiles both to Android and iOS and can be used in your Android and iOS applications So when you want to add library which is designed for Android only, your are adding it directly to Android app. The same is for iOS. Is it a little bit more clear?
1
s
yeah, it is clear but i’m still having trouble implementing >< here’s my androidApp build.gradle dependency list:
e
And what kind of trouble do you have with this setup? Basically your dependencies looks a little bit odd, because your declare compose libraries and then again add Android View version of this Calendar library (although it has compose version too)
s
@Evegenii Khokhlov well, the Calendar library isn’t being recognized. i thought it might be that i hadn’t downloaded the sources for the specific compileSDK i’m using, and so i did that but nothing changed.
e
where exactly it hasn’t been recognized, in androidApp module?
s
@Evegenii Khokhlov yes - in the screenshot i sent, that is the build.gradle dependency list in the androidApp module. it says no documentation found
e
I believe this message doesn’t necessary mean, that library hasn’t been recognized. Have you got any errors on run? And also have you added the JitPack repository, according to the documentation of the library?
s
@Evegenii Khokhlov oh lol. well that’s my fear of making any changes/steps unless i am 100% sure of what’s going on ! please excuse me haha. and yes! i had added the jitpack link to my settings.gradle and build.gradle files already
🙌 1