Kotlin Multiplatform Mobile allows you to use a single codebase for the business logic of iOS and Android apps.
Questions tagged [kotlin-multiplatform-mobile]
158 questions
16
votes
2 answers
KMM: Compilation failed: Unexpected IrType kind: KIND_NOT_SET
I'm trying to run tests in the shared library.
Setup (versions should be the same for both machines - all are up to date as of today):
Kotlin 1.6.21 (tried 1.6.20 and 1.6.10)
OpenJDK 11.0.15 (via Homebrew)
IntelliJ
Build #IC-221.5591.52, built on…

peter.o
- 3,460
- 7
- 51
- 77
14
votes
5 answers
How to configure an iOS Application for Kotlin Multiplatform in Android Studio?
I want to add a Run/Debug Configuration for an iOS Application for a Kotlin Multiplatform Mobile application in Android Studio 4.1.2. However, there seems to be a problem with the configuration for iOS.
In the screenshot below you can see the…

Jan Deinhard
- 19,645
- 24
- 81
- 137
11
votes
8 answers
KMM project setup with cocoaPods fails on first compile
I created a new KMM project and selected Cocoapods for the iOS framework distribution and as soon as it finished building it threw the following error:
Executing of 'pod install' failed with code 1.
Error message:
Please, check that…

barryalan2633
- 610
- 7
- 21
8
votes
1 answer
Jsoup alternative for Kotlin Multiplatform?
I have a aplication Scraping Android App and I want get a IOS version using Kotlin Multiplaform and need replace Jsoup.
I can use ktor as http client for post command and other, but, I need a powerful HTML parser.
Any ideas?

MiguelAngel_LV
- 1,200
- 5
- 16
8
votes
0 answers
How to configure KMM project to support different buildTypes
When I switch build variants I got compilation error, but the problem is only for non default build variants (debug & release). So if I define customBuild { } and then choose that one, it fails with this error log:
The consumer was configured to…

Jemo Mgebrishvili
- 5,187
- 7
- 38
- 63
8
votes
2 answers
No matching variant of Kotlin Multiplatrom Mobile library found
I have a Kotlin Multiplatform Mobile library that I published to Maven Central. I am also trying to use this library in a non-KMM Android app. When I declare the dependency in the android app I get this error
Execution failed for task…

tyczj
- 71,600
- 54
- 194
- 296
7
votes
4 answers
KMM + Compose: Unresolved reference: drawable
I have a KMM application in which the android target uses Jetpack Compose. I am getting the following error when I try to use a drawable resource:
e: [...]/OnboardingScreen.kt: (33, 46): Unresolved reference: drawable
This is the result of trying…

svprdga
- 2,171
- 1
- 28
- 51
7
votes
0 answers
kmm ios simulator service version does not match expected service version error
After creating a kmm application using the wizard from the kotlin-multiplatform-mobile plugin, I tried running the ios simulator and got the error below.
kotlin multiplatform mobile java.lang.IllegalStateException: Unsupported Xcode version 12.4,…

Dylan
- 375
- 1
- 2
- 12
7
votes
1 answer
KMM with Java sources in common (shared) module
As a platform limitation we can't use Java sources with Kotlin Multiplatform Mobile.
But if Kotlin is 100% compatible with Java, why can't we use Java with Kotlin Multiplatform Mobile? I mean use it not only in Android or JVM section only, but in…

badadin
- 507
- 1
- 5
- 18
7
votes
1 answer
How to perform queries in background thread?
I'm currently looking at having a KMM application backed by SQLdelight for all domain-related operations.
SQLdelight seems to provide really nice interfaces, however it seems like all the write calls (insert/update/delete) are implemented using…

Rémi Vansteelandt
- 93
- 2
7
votes
3 answers
KMM on iOS: There is no event loop. Use runBlocking { ... } to start one
I'm trying to use coroutines in a Kotlin Multiplatform project. I'm not experienced in either.
I'm trying to call this function
fun startFlow {
coroutineScope.launch {
withContext(defaultDispatcher) {
myFlow.collect { next ->…

David Corsalini
- 7,958
- 8
- 41
- 66
6
votes
1 answer
KMM with iOS Arm64 Binary Framework (.xcframework) and cinterop
I'm following the guide here to try and use an iOS framework without CocoaPods in a new KMM project:
https://kotlinlang.org/docs/kmm-add-dependencies.html#without-cocoapods
I have an existing, working .xcframework that I added to the project under…

mutable2112
- 439
- 4
- 15
6
votes
2 answers
KMM - Error Task 'embedAndSignAppleFrameworkForXcode' not found in project ':shared'
I created a project to demo Kotlin Multiplatform Mobile. I built and ran it successfully on both devices: Android and iOS. After that, I re-ran the project on iOS. It had an error.
> Configure project :shared
Kotlin Multiplatform Projects are an…

PhongBM
- 799
- 10
- 23
6
votes
3 answers
Gradle doesn't look for dependency in the right way
I'm trying to add moko a dependency to a kotlin multiplataform on gradle.
org.gradle.internal.resolve.ArtifactNotFoundException: Could not find mvvm-livedata-0.9.1-samplessources.jar (dev.icerock.moko:mvvm-livedata:0.9.1).
Searched in the following…

Jhonata Ávila
- 385
- 1
- 13
6
votes
4 answers
KMM: How to reference the shared module into an already existing iOS project
I have followed the KMM hands-on tutorial on how to build a sample app with KMM and I was able to complete all the steps successfully! (Yu-huu!) Now I am trying to do a small POC in the production application. So I created a new KMM shared module…

Andy Res
- 15,963
- 5
- 60
- 96