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…
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…
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 =…
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…
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…
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…
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…
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…
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…
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…
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 =…
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…
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…
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 {…
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…
asdfgh
  • 23
  • 2
1
2