Questions tagged [kmm]
28 questions
10
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…
![](../../users/profiles/723090.webp)
Mark
- 15,245
- 6
- 95
- 113
3
votes
1 answer
Does KMM works in Android Studio - Windows Version
I need to build an app for both iOS and Android.
I am getting this error after restarting Android Studio.
Kotlin Multiplatform Mobile plugin issue
Kotlin Multiplatform Mobile plugin is supposed to work on macOS only
I am using a windows…
![](../../users/profiles/11341616.webp)
Muath Nassar
- 31
- 1
2
votes
2 answers
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 =…
![](../../users/profiles/15286582.webp)
asdfgh
- 23
- 2
2
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…
![](../../users/profiles/5849894.webp)
odiggity
- 1,039
- 9
- 22
2
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…
![](../../users/profiles/5279996.webp)
Braian Coronel
- 17,823
- 4
- 30
- 33
2
votes
1 answer
Kotlin Multiplatform Mobile - Issue while running ios app from Android studio
I'm exploring KMM, I have done with the setup in Android Studio. I could able to run the Android app perfectly, but when I try to run the ios app, facing an issue in configuration setup. Xcode project scheme Dropdown is empty. I have attached a…
![](../../users/profiles/1069783.webp)
Maverick
- 324
- 1
- 5
- 14
2
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…
![](../../users/profiles/1370087.webp)
Benjamin
- 5,952
- 3
- 33
- 57
1
vote
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…
![](../../users/profiles/6511006.webp)
Snipe3000
- 149
- 13
1
vote
0 answers
Incompatible Kotlin/Native libraries
Android Studio 4.1.3
Brand new KMM project. All defaults accepted. No new code added, right out of the gate:
Incompatible Kotlin/Native libraries
There are 2 third-party libraries attached to the project that were compiled with an older…
![](../../users/profiles/697392.webp)
Dmitri
- 1,199
- 10
- 16
1
vote
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…
![](../../users/profiles/1300214.webp)
Pixel
- 2,397
- 3
- 29
- 48
1
vote
1 answer
Kotlin coroutines delay do not work on IOS queue dispatcher
I have a KMM app, and there is code:
fun getWeather(callback: (WeatherInfo) -> Unit) {
println("Start loading")
GlobalScope.launch(ApplicationDispatcher) {
while (true) {
val response =…
![](../../users/profiles/11161744.webp)
Alexandr Izmaylov
- 35
- 1
- 5
1
vote
1 answer
Kotlin Multiplatform Mobile: Project already has a CocoaPods dependency with name SDWebImage
I have created a demo project to integrate cocoapods into the KMM project. I have followed this link from the official website. At step 3 while reimporting the project, I am receiving the following error.
Project already has a CocoaPods dependency…
![](../../users/profiles/8866237.webp)
Fatin Wasta
- 325
- 3
- 15
1
vote
0 answers
My iPhone won't show up in "Execution List" on Android Studio
I'm trying my hand at Kotlin Multiplatform Mobile, and am trying to run the demo app on an iPhone. I am able to run it easily on the iPhone Simulator from Android Studio itself, but if I connect my real iPhone to the MacBook, I am unable to see it…
![](../../users/profiles/5590095.webp)
Vyom Maitreya
- 240
- 2
- 6
0
votes
0 answers
Kotlin kmm create variable with type: CValuesRef
var cryptor: CValuesRef
With kotlin KMM, in project iosMain
I can't init data for cryptor.
I need init data for var because i need using func CCCryptorCreateWithMode
I try
var cryptor: CValuesRef = memScoped {…
![](../../users/profiles/4447118.webp)
Tau Là Thế
- 1
- 1
0
votes
0 answers
Nested Package Dependencies Modules Error
I have created 3 package with the following dependency structure
Package1
+ Package2
+ Package3
RandomPackage
+ Package1
For Package1 I added package2 and Package3 under Dependencies and Link Binary With Libaries
For RandomPackage I only…
![](../../users/profiles/15286582.webp)
asdfgh
- 23
- 2