All Questions
Tagged with kotlin-multiplatform-mobile or kotlin-multiplatform
2,216 questions
0
votes
0
answers
31
views
Kotlin Multiplatform: Incompatible 'embedAndSign' Task with CocoaPods Dependencies in Xcode
I have a Kotlin Multiplatform Mobile project (KMP) targeting Android + iOS. My setup:
Kotlin version: 2.2.21
Kotlin Multiplatform plugin: 2.2.21
CocoaPods plugin in build.gradle.kts:
plugins {
...
-1
votes
0
answers
46
views
I cant seem to find a gradle task that runs all tests in my KMP project
I am working on a kmp project. I am implementing a multi-module architecture. I cant seem to find a gradle task that runs all tests in my project. All the tasks finish without finding any tests. I ...
0
votes
0
answers
39
views
UIKitViewController in Compose Multiplatform loses state on device rotation
I am building a Kotlin Multiplatform app where I want to use shared UI with Compose for both Android and iOS. However, I need some native views with their own state for certain parts of the app, so I’...
0
votes
0
answers
66
views
KMM - cannot see interface from Kotlin in IOS
I tried to follow: https://medium.com/@rishabh1112131415/how-to-handle-permissions-in-kotlin-multiplatform-without-external-libraries-05d7203237e3
but I get an error: No type named '...
0
votes
0
answers
80
views
How to securely store values in iOS Keychain in a Kotlin Multiplatform (KMP) app? toNSData() not recognized
I’m building a Kotlin Multiplatform app (KMP) and want to store sensitive values like auth tokens securely on iOS using Keychain (instead of NSUserDefaults). I found this code on Medium, but it does ...
1
vote
0
answers
85
views
Kotlin Multiplatform: Could not resolve <unknown coordinates> for iOS targets when building Google Maps module
I’m currently working on a Kotlin Multiplatform (KMP) project that includes a module for Google Maps integration (:core:maps:v2).
Everything works fine on Android, but when I try to build for iOS, I ...
2
votes
1
answer
173
views
Android Waiting for Target Device to Come Online in IntelliJ and Android Studio
PROBLEM
Hi, I'm getting an endless loop of "Waiting for all target devices to come online", or the emulator just shows the Android intro but never loads.
The JVM version of the program runs ...
2
votes
1
answer
116
views
How to create a searchable dropdown/autocomplete TextField in Jetpack Compose without the suggestion list stealing focus?
My Goal:
I'm trying to implement an autocomplete TextField in Jetpack Compose. The desired behavior is:
A user starts typing in a TextField.
A list of suggestions, filtered by the user's input, ...
0
votes
1
answer
230
views
How to securely store JWT in Kotlin Multiplatform (KMP) app for Android and iOS
I’m building a Kotlin Multiplatform (KMP) app that runs on both Android and iOS.
Currently, I’m storing the JWT token using Preferences DataStore on Android
androidx.datastore.preferences.core
...
0
votes
0
answers
51
views
Why can't I use @JsExport in commonMain? Workaround with expect/actual seems to work fine
So I'm working on a Kotlin Multiplatform project and ran into this weird limitation - you can't use @JsExport in commonMain, only in jsMain. This seems really counterintuitive since the whole point of ...
0
votes
0
answers
126
views
Compose Multiplatform: How to lock specific screens to portrait or landscape (Android & iOS)
I’m building an app with Compose Multiplatform (Kotlin Multiplatform) and I need to control the screen orientation for certain screens.
For example:
Screen X should always be shown in landscape mode.
...
1
vote
0
answers
53
views
How to Handle a Redirect with a Custom URI Scheme in Compose Multiplatform for Desktop (jvmRun) on Windows?
I am developing a desktop application for Windows using Compose Multiplatform and implementing an external web login flow (e.g., OAuth). After a successful login in the browser, the service needs to ...
2
votes
2
answers
130
views
Why does my `RoomDatabase` instance not have all the public methods?
I have a Kotlin project for desktop which uses Room DB.
The main function looks like this:
import androidx.room.Database
import androidx.room.Room
import androidx.room.RoomDatabase
import androidx....
0
votes
0
answers
78
views
Kotlin Multiplatform: slow iOS debugging in Android Studio?
I’ve been experimenting with debugging the iOS side of a Kotlin Multiplatform project directly in Android Studio. Overall, it works — I can set breakpoints in shared Kotlin code, step through logic, ...
2
votes
1
answer
158
views
Missing CircularWavyProgressIndicator after updating to Compose Multiplatform 1.9.0-beta03
I recently updated my project to Compose Multiplatform 1.9.0-beta03 and Material3 1.9.0-beta03. After the update, I can no longer access:
CircularWavyProgressIndicator
ButtonDefaults....
1
vote
1
answer
51
views
How to migrate Room database when primary key data type changes
@Entity
data class Log(
@PrimaryKey val id: String,
val date: Long,
val note: String,
)
@Entity(
foreignKeys = [
ForeignKey(
entity = Log::class,
...
1
vote
0
answers
39
views
How to set deeplink in Kotlin KMP desktop windows
In the kotlin KMP documentation found
For Windows apps, deep link schemes can be declared by adding keys with necessary information to the Windows registry (for Windows 8 and earlier) or by ...
0
votes
0
answers
53
views
How to make common dropdown for two TextFields in Jetpack Compose?
I want to make a common dropdown for two TextField. I have manage to do something like following. But there is a problem with focusing. When I click again on the second TextField to open dropdown, it ...
0
votes
1
answer
176
views
absolute positioned element in Jetpack Compose
In CSS, we have absolute position attribute to define the layer and position of an element within in our app. The absolute position ignores the default styling flow of the structure and can also work ...
1
vote
0
answers
73
views
Xml vector image in Kotlin multiplatform
i have a very simple image
Image(
imageVector = vectorResource(Res.drawable.swords),
contentDescription = null,
modifier = Modifier.width(82.dp)
.clip(shape = ...
2
votes
1
answer
210
views
Setting up cocoapods on kmp (kotlin multiplatform) project in separate gradle file
Im trying to setup cocoapods in kmp project on android studio in separate cocoapods.gradle.kts file to be able to exclude it if platform is windows and run it if its mac.
In my build.gradle.kts:
if (...
0
votes
0
answers
72
views
Kotlin Script Execution Not Working in OSGI Environment
I’m working on integrating Kotlin scripting support into an OSGi environment. The project is Maven-based, and I’ve included all the necessary dependencies for .kts script execution. Currently, I’m ...
0
votes
0
answers
56
views
How to access classes, methods and send parameters from native iOS to the KMP app?
When I start the iOS app, I want to send parameters from Firebase to my KMP project.
I put annotations in the KMP Kotlin class so that it would be visible, the bridge class that is generated in ...
0
votes
1
answer
100
views
How to override language to get localised string for a specific language in Kotlin Multiplatform project?
I have 2 language support in my app. Language files are arranged like below:
composeApp/src/commonMain/composeResources/values/lang.xml
composeApp/src/commonMain/composeResources/values-bn/lang.xml
...
1
vote
1
answer
235
views
How to get screen width in KMP(IOS and Android)?
I am building a KMP project, and I need to calculate the screen width and display data accordingly.
How can I get the width in DP?
The current implementation does not give the correct width.
Common-
...