For questions related to Kotlin Multiplatform Mobile, also known as KMM. It is an SDK for iOS and Android app development. Not to be confused with Kotlin Multiplatform which is abbreviated as KMP. KMM is an subset of KMP.
Questions tagged [kmm]
118 questions
12
votes
3 answers
Use Gradle sub-projects with Kotlin multiplatform
I'm using Kotlin multi-platform (JVM & JS), which in IDEA creates three projects: demo, demo-js and demo-jvm.
I would like to split the common code into more subprojects/submodules. Let's say I add commonmod; how do I make it compile?
The error…

Mark
- 18,730
- 7
- 107
- 130
11
votes
2 answers
Execution failed for task ':shared:podInstall'
I am very new to KMM (Kotlin Multiplatform Mobile) and iOS development (including CocoaPods). I have come across the following build error in Android Studio.
Execution failed for task ':shared:podInstall'.
java.io.IOException: Cannot run program…

user15134436
- 131
- 1
- 4
8
votes
1 answer
KMM Project: Expected class has no actual declaration in module for JVM
I have a KMM project that is working perfectly except Android Studio gives an error on every expect function/value in my project complaining the actual version of it doesn't exist for JVM.
The A in a yellow diamond to the side of it shows both the…

Alchitry
- 1,369
- 1
- 16
- 29
8
votes
1 answer
Define global configuration variables in KMM
In native android project, we can define BuildConfig variables which can be change based on the selected build type (debug or release). For this we can add the code below in app level gradle file
buildTypes {
release {
buildConfigField…

S Haque
- 6,881
- 5
- 29
- 35
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
Why do I get "Unresolved reference: platform" when using the firebase-bom dependency with KMM
When I attempt to add the Firebase-bom dependency using the following block in a Kotlin Multiplatform Mobile (KMM) project's shared module, the word platform appears in red error text and the Gradle build fails with "Unresolved reference: platform."…

colintheshots
- 1,992
- 19
- 37
6
votes
0 answers
Missing common classes on a KMM project when integrated in an Android App as a Gradle project
I have an existing Android app where I like to integrate a KMM library project as a git submodule. We want to integrate a git submodule on local builds and using a maven repository dependency on CI builds.
To achieve this, I added the directory of…

elcolto
- 961
- 7
- 11
6
votes
2 answers
Cannot access expected class constructor parameters in kotlin multi-platform
I'm currently working on a multi-platform module using kotlin. To do so, I rely on the expect/actual mechanism.
I declare a simple class in Common.kt:
expect class Bar constructor(
name: String
)
I'd like to use the defined class in a common…

Benjamin
- 7,055
- 6
- 40
- 60
5
votes
0 answers
how can we observe specific changes made to SQLDeLight DB and emit them?
This is my table structure
CREATE TABLE Missions(
MissionID INTEGER NOT NULL UNIQUE,
MilestoneID INTEGER NOT NULL,
MissionExpiry TEXT,
MissionStatus TEXT,
Count INTEGER DEFAULT 0,
MilestoneList TEXT,
UpdatedTime TEXT,
…

Sushma K
- 51
- 2
5
votes
1 answer
SQLDelight and data classes with one to many relations in Kotlin
I am trying to create a small app using Kotlin Multiplatform where i can save book titles and their authors but i'm struggling with the data classes and how to map them together so that i get the author with all of their books and the publish…

Andy
- 53
- 3
5
votes
1 answer
Unresolved reference: iosSimulatorArm64
I got a blocker when trying to convert existing simple android app writing in kotlin to KMM.
Below is the following error.
Please initialize at least one Kotlin target in 'kmmsharedmodule (:kmmsharedmodule)'.
Read more…

KSDev
- 261
- 1
- 12
5
votes
4 answers
Not able to import @Inject annotation
I have implemented Hilt dependencies in my project, but when I need the @Inject annotation for my constructor, it's not working. basically when I tried to import it manually i found out, the inject folder inside javax is empty. So the structure is…

user477174
- 61
- 3
5
votes
1 answer
Adding Ktor To Kotlin Multiplatform Mobile results in Unresolved reference: HttpClient
I can't get Ktor to work in a KMM project, I just get a Unresolved reference: HttpClient error when trying to reference any Ktor classes. If I try to manually add the ktor import it says Unresolved reference io. Other dependencies like Kermit…

odiggity
- 1,496
- 16
- 29
4
votes
2 answers
Kotlin Multiplatform: Can't reference class in commonMain sourceset from another module's androidMain sourceset
I have two multiplatform modules shared and other in a standard multiplatform template project that targets Android and iOS.
shared defines a class in commonMain source set
class SharedGreeting()
other is setup to depend on shared like this in the…

Rabie Jradi
- 563
- 4
- 14
4
votes
0 answers
Kotlin collections for SQLDelight file are not importing (KMM)
In my KMM project I'm using SQLdelight. My sample table has a List.
Table:
CREATE TABLE profile (
nikName TEXT,
secretKey TEXT,
description TEXT,
tagList TEXT AS List
);
According to documentation I created adapter:
//TODO we cant use comas…

Dmitry
- 130
- 6