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
4
votes
2 answers
How to use @Parcelize annotation in shared module of Kotlin Multiplatform Project
I was developing an Kotlin Multiplatform App where I would like to use @Parcelize annotation in my model class. But in Kotlin Multiplatform plugins the @Parcelize annotation, in the kotlin version which I'm using is in the android.extensions plugin,…

Manuel Lucas
- 636
- 6
- 17
4
votes
1 answer
Getting unresolved reference on @Serializable in commonMain of Share module in KMM project
The IDE is highlighting the those serialization imports as unresolved. But when run the app I am getting the result here.
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
…

Venkatesh Paithireddy
- 41
- 1
- 5
4
votes
1 answer
KMM: embedAndSignAppleFrameworkForXcode task not found
I have created a basic KMM by following "Create your first app" guide
https://kotlinlang.org/docs/kmm-create-first-app.html
Then I've tried to build the framework with the following command from Terminal in Android Studio.
./gradlew…

Pavel
- 2,610
- 3
- 31
- 50
4
votes
3 answers
Could Kotlin Multiplatform Mobile work with Jetpack Compose?
There are 2 problems that do not allow to generate compatibility between these technologies
Jetpack Compose
The first problem is that it only works with Android Studio Canary x.
Android Studio 4.2 Beta 6
Jetpack Compose is a preview feature, and…

Braian Coronel
- 22,105
- 4
- 57
- 62
3
votes
0 answers
Firebase Crashlytics - crash reports won't de-obfuscate
I have recently integrated Firebase Crashlytics to my KMM app and set up a release build with obfuscation. I followed the official documentation (https://firebase.google.com/docs/crashlytics/get-deobfuscated-reports?platform=android) in order to…

Artur Popławski
- 81
- 4
3
votes
2 answers
Kotlin Multiplatform issue : Type 'org.gradle.api.tasks.Copy' property 'sign' doesn't have a configured value
I am trying to build a KMM project everything works fine in Android also in iOS simulator but when I connect an iOS device I get the below error .
FAILURE: Build failed with an exception.
What went wrong:
A problem was found with the configuration…

RaghavPai
- 652
- 9
- 14
3
votes
2 answers
How can i add headers to ktor request if i use submitFormWithBinaryData()?
Code below is to upload an file using ktor and kmm ...
val client = HttpClient(Apache) {}
val file = File("path/to/some.file")
val chatId = "123"
client.submitFormWithBinaryData(
url =…

dawoud
- 104
- 1
- 6
3
votes
1 answer
How Do Transitive Dependencies in KMM and iOS work?
Lets say I have a package, Shared Package that is shared with two KMM projects: KMM Project A and KMM Project B.
So we have Shared Package -> KMM Project A and Shared Package -> KMM Project B.
Now I want to use both KMM Project A and KMM Project B…

Citut
- 847
- 2
- 10
- 25
3
votes
1 answer
Refresh auth token in Ktor for iOS Http client
I have a KMM project in which I have been using Ktor for the API calls. I have a requirement in which I need to update my access token with the help of refresh tokens if they are expired. Basically I just need to add an authentication module in my…

WhiteSpidy.
- 1,107
- 1
- 6
- 28
3
votes
1 answer
How to convert a JSON string to an Object in KMM
Previously, I asked this question: Implementing generic method in interface that uses implementors class which allowed for an object to be converted to a JSON string.
But, now I would like to reverse the process. Ideally this would look…

aepryus
- 4,715
- 5
- 28
- 41
3
votes
3 answers
Implementing generic method in interface that uses implementors class
I want a method on a parent Interface / Abstract Class that makes use of generics methods to pass in the class of the implementing class.
interface Domain {
fun toJSON(): String { return Json.encodeToString(this) }
}
@Serializable
class User:…

aepryus
- 4,715
- 5
- 28
- 41
3
votes
2 answers
KMM Application Cannot Run In Simulator
I am new to KMM and I am trying to integrate KMM project as a pod to my sample Xcode Project. I can link the KMM Pod to my Xcode project. However if I try to call one of the function, below error yielded. If I do not call any of the KMM function, it…

Foster
- 345
- 1
- 5
- 18
3
votes
1 answer
Android Studio KMM Project with c/c++ module Error
We are trying to build a KMM (Kotlin Multiplatform Mobile) app for ios and android. There are c/c++ modules included in this project.
At iOS build we are getting this error from a .h file:
error: use of '@import' when modules are disabled
In xcode…

Snipe3000
- 321
- 3
- 15
3
votes
1 answer
Coroutine - Avoiding using Suspend function
I am new to KMM and coroutines. Is there a way to await for a response from an async function without needing to make the dependent function also suspend?
Code Example
// In HttpClient.kt in commonMain
class MyHttpClient {
val client =…

asdfgh
- 33
- 4
3
votes
1 answer
Kotlin Multiplatform Mobile can't find klib package
I've read these SO posts 1, 2, 3 which faced a similar problem. I'm trying to use a .klib in my KMM Android project. The Klib is built from library.h C header. Here's what I did:
I built the Kotlin Library
Using the following Gradle block in the KMM…
user1300214