Slide 1

Slide 1 text

The rollercoaster of releasing an Android, iOS, and macOS app with Kotlin Multiplatform Marco Gomiero @marcoGomier Senior Android Developer @ Airalo Google Developer Expert for Kotlin

Slide 2

Slide 2 text

@marcoGomier feedflow.dev/ FeedFlow

Slide 3

Slide 3 text

@marcoGomier feedflow.dev/ FeedFlow

Slide 4

Slide 4 text

@marcoGomier FeedFlow feedflow.dev/

Slide 5

Slide 5 text

@marcoGomier Android • “Easy” for an Android Developer • Sign the app • Upload to Play Store

Slide 6

Slide 6 text

@marcoGomier • Sign the app • Provisioning profiles • Upload to TestFlight • All handled by Xcode (or manually on the CI) iOS

Slide 7

Slide 7 text

@marcoGomier • JAR • “Manual” distribution • App Store macOS ❌

Slide 8

Slide 8 text

@marcoGomier No Xcode, need to go manual \o/

Slide 9

Slide 9 text

@marcoGomier macOS - “Manual” distribution • Sign the app • Notarization

Slide 10

Slide 10 text

@marcoGomier

Slide 11

Slide 11 text

@marcoGomier macOS - “Manual” distribution • Sign the app • Notarization • Distribute the app

Slide 12

Slide 12 text

@marcoGomier

Slide 13

Slide 13 text

@marcoGomier macOS - App Store • Sign the app • Provisioning profiles • Upload to TestFlight

Slide 14

Slide 14 text

@marcoGomier Upload to TestFlight: Transporter (or CI) https://apps.apple.com/us/app/transporter/id1450874784?mt=12

Slide 15

Slide 15 text

@marcoGomier

Slide 16

Slide 16 text

@marcoGomier Fixed with Compose 1.6.10 https://github.com/JetBrains/compose-multiplatform/pull/4271

Slide 17

Slide 17 text

@marcoGomier compose { desktop { application { macOS { minimumSystemVersion = "12.0" } } } } }

Slide 18

Slide 18 text

@marcoGomier

Slide 19

Slide 19 text

@marcoGomier https://developer.apple.com/documentation/security/app_sandbox/protecting_user_data_with_app_sandbox

Slide 20

Slide 20 text

@marcoGomier

Slide 21

Slide 21 text

@marcoGomier https://github.com/xerial/sqlite-jdbc/tree/master/src/main/resources/org/sqlite/native/Mac/aarch64

Slide 22

Slide 22 text

@marcoGomier Target-specific assets compose.desktop.application.nativeDistributions { appResourcesRootDir.set(project.layout.projectDirectory.dir("resources")) } @marcoGomier

Slide 23

Slide 23 text

@marcoGomier val isSandboxed = System.getenv("APP_SANDBOX_CONTAINER_ID") != null if (isSandboxed) { val resourcesPath = System.getProperty("compose.application.resources.dir") // sqlite-jdbc System.setProperty("org.sqlite.lib.path", resourcesPath) System.setProperty("org.sqlite.lib.name", "libsqlitejdbc.dylib") }

Slide 24

Slide 24 text

@marcoGomier 🎉

Slide 25

Slide 25 text

@marcoGomier Crash Reporting & Logging

Slide 26

Slide 26 text

@marcoGomier Firebase Crashlytics

Slide 27

Slide 27 text

@marcoGomier https://github.com/touchlab/CrashKiOS

Slide 28

Slide 28 text

@marcoGomier Firebase Crashlytics Sentry Java SDK

Slide 29

Slide 29 text

@marcoGomier https://github.com/touchlab/Kermit

Slide 30

Slide 30 text

@marcoGomier internal expect fun crashReportingLogWriter(): LogWriter actual fun crashReportingLogWriter(): LogWriter = CrashlyticsLogWriter() actual fun crashReportingLogWriter(): LogWriter = SentryLogWriter()

Slide 31

Slide 31 text

@marcoGomier I18n

Slide 32

Slide 32 text

@marcoGomier https://github.com/adrielcafe/lyricist

Slide 33

Slide 33 text

@marcoGomier val feedFlowStrings: Map = mapOf( Locales.It to ItFeedFlowStrings, Locales.En to EnFeedFlowStrings, Locales.De to DeFeedFlowStrings, ) Text(strings.searchHintTitle) let strings = feedFlowStrings["it"] ?? EnFeedFlowStrings Text(text = LocalFeedFlowStrings.current.feedUrl)

Slide 34

Slide 34 text

@marcoGomier More reading https://www.marcogomiero.com/posts/2024/kmp-app-ci

Slide 35

Slide 35 text

> Twitter: @marcoGomier > Github: prof18 > Website: marcogomiero.com > Mastodon: androiddev.social/@marcogom Thank you, and don’t forget to vote

Slide 36

Slide 36 text

Bibliography / Useful Links • https: / / feedflow.dev/ • https: / / help.apple.com/itc/transporteruserguide/en.lproj/static.html#apd70774093eddb4 • https: / / developer.apple.com/documentation/security/app_sandbox/protecting_user_data_with_app_sandbox • https: / / github.com/JetBrains/compose-multiplatform/blob/master/tutorials/Native_distributions_and_local_execution/ README.md#adding-files-to-packaged-application • https: / / firebase.google.com/products/crashlytics • https: / / docs.sentry.io/platforms/java/ • https: / / github.com/touchlab/CrashKiOS • https: / / github.com/touchlab/Kermit • https: / / github.com/adrielcafe/lyricist • https: / / www.jetbrains.com/help/kotlin-multiplatform-dev/compose-images-resources.html#strings • https: / / www.marcogomiero.com/posts/2024/kmp-ci-android • https: / / www.marcogomiero.com/posts/2024/kmp-ci-ios • https: / / www.marcogomiero.com/posts/2024/kmp-ci-macos-github-releases • https: / / www.marcogomiero.com/posts/2024/kmp-ci-macos-appstore • https: / / www.marcogomiero.com/posts/2024/compose-macos-app-store/