Hi everyone, I was looking into publishing my KMM ...
# multiplatform
s
Hi everyone, I was looking into publishing my KMM project as a .aar file, but the documentation here: https://kotlinlang.org/docs/multiplatform-publish-lib.html is too vague for me as a beginner to mobile development in general. Does anyone have a list of steps/commands I can run in order to get a .aar file for my KMM project, and something similar for the iOS side as well?
s
I would highly suggest you to follow Jetbrain’s hands-on guide for publishing multiplatform library to maven: https://kotlinlang.org/docs/multiplatform-library.html It will help you understand the steps needed. While following it, you can first try to publish the Android lib (.aar) to local Maven repository and consume it in a sample Android project to check if everything is working fine. Once you are sure, then you can follow the next section to publish the lib to Maven central. You will need to register an account on Sonatype. https://kotlinlang.org/docs/multiplatform-library.html#publish-your-library-to-the-external-maven-central-repository Roughly the steps would be: 1. Add the
maven-publish
plugin to your shared module’s buildscript (build.gradle) 2. Specify the publish variants of you android lib (https://kotlinlang.org/docs/multiplatform-publish-lib.html#publish-an-android-library) 3. Register an account on Sonatype, if not already done 4. Setup up publication with your MavenCentral account (Sonatype) 5. Run the
publishAndroidReleasePublicationToMavenCentralRepository
gradle task