2,214 questions
0
votes
0
answers
20
views
How to reliably prevent screenshots on iOS in Kotlin Multiplatform (Compose Multiplatform)?
I'm building an app using Kotlin Multiplatform (Compose Multiplatform) and need to prevent screenshots on sensitive screens (QR codes) for security reasons.
What Works:
Android - Using FLAG_SECURE ...
-6
votes
0
answers
25
views
Best Practices for Naming Modules and Packages in Kotlin Multiplatform Projects [closed]
I am working on a **Kotlin Multiplatform (KMP)** project with a **multi-module architecture**, and I am confused about the best practices for naming modules and packages.
I have searched for a while, ...
0
votes
1
answer
55
views
The 'org.jetbrains.kotlin.multiplatform' plugin deprecated compatibility with Android Gradle plugin: 'com.android.application'
I’m running a Compose Multiplatform project and encountering an unexpected warning at build time. Any insights would be appreciated.
com.android.application
The 'org.jetbrains.kotlin.multiplatform' ...
1
vote
1
answer
33
views
Can we integrate NextJs in KMP project?
I'm currently learning KMP for Android, iOS, Web with native UI approach so that I can develop an application that works everywhere. I want to know that the way we use React+TS for making native UI ...
1
vote
0
answers
74
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 {
...
Best practices
0
votes
0
replies
44
views
How to include Java in this project and enable mixed development with both Java and Kotlin
How to include Java in this project and enable mixed development with both Java and Kotlin.
I want to know how to use Java and Kotlin interoperably in a Kotlin Multiplatform Compose Desktop project, ...
0
votes
0
answers
53
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’...
1
vote
0
answers
81
views
Android emulator not running from Play button in both IntelliJ and Android Studio on Linux, but it does from command line, and logcat show nothing
PROBLEM
Hi, I have IntelliJ Ultimate 2025.2.4, and Android Studio 2025.2.1. When I create a new default project in either one > download all the sources it needs > sync gradle > then click ...
0
votes
0
answers
136
views
Kotlin Multiplatform + Google Maps on iOS: Why do I still need .def file with SPM? Interop not working without cinterop
I am integrating Google Maps SDK for iOS into my Kotlin Multiplatform (KMP) project. Earlier I was using CocoaPods and everything was working. Now I migrated to Swift Package Manager (SPM) and removed ...
0
votes
1
answer
80
views
VLCJ on macOS in Kotlin Multiplatform project: Audio plays but no video rendering
I built a cross-platform project using Kotlin Multiplatform targeting Android, Windows, and macOS.
Now, I need to implement a media player that must support HLS. Because of this, I ruled out the ...
1
vote
0
answers
96
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
0
answers
42
views
VNDocumentCameraViewController corrupting Compose's popup system on iOS
After using VNDocumentCameraViewController in Compose Multiplatform iOS, all popup-based components (AlertDialog, DatePickerDialog, ExposedDropdownMenuBox) stop working.
Open AlertDialog - works fine
...
2
votes
1
answer
192
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 ...
1
vote
0
answers
58
views
Unable to setup Kapt for dagger in kotlin multiplatform
I'm trying to set up Dagger in a Kotlin Multiplatform module for Android only as a POC for a migration of a project.
Therefore, I needed to set up kapt and followed the instructions in Kmp in Kapt ...
2
votes
1
answer
170
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
0
answers
35
views
Can we expose interfaces from `commonMain` to JS that can be implemented in Typescript?
TLDR: can we expose interfaces from commonMain to JS that can be implemented in Typescript?
Exposing from jsMain appears to work fine:
If I expose interface from jsMain with external and @JsExport
@...
1
vote
1
answer
360
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
1
answer
121
views
How to speed up DataStore reads in a Kotlin Multiplatform (KMP) project?
I’m using Jetpack DataStore (Preferences) in a Kotlin Multiplatform Mobile (KMM/KMP) project to store some user data, including a JSON-serialized object:
class DataStoreVM(
private val dataStore: ...
0
votes
0
answers
63
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 ...
1
vote
0
answers
95
views
Trouble compiling a basic kotlin multiplatform app for ios
I've been reworking an android app to make it a compatible with the the kotlin multiplatform framework. After getting stuck I decided to start with a fresh, very basic setup and build out from there. ...
0
votes
0
answers
166
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
1
answer
233
views
Kotlin Multiplatform Plugin not working properly
Kotlin Multiplatform for IntelliJ Idea (Community) Linux and Windows released. Version: 0.9-252.26199-IJ_CE-176. I have installed the plugin and restart the ide it says
Plugins 'Kotlin Multiplatform', ...
1
vote
0
answers
67
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 ...
5
votes
3
answers
409
views
Can not use kotlinx-datetime:0.7.1 library with rememberDatePickerState() function of material3
Material3 rememberDatePickerState() crashing in desktop and iOS platforms.
I am using kotlin = "2.2.10" version for my Kotlin Compose Multiplatform (KMP/CMP) project. It runs fine on android ...
2
votes
2
answers
137
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....
4
votes
1
answer
242
views
In Kotlin Multi Platform and JetPack Compose, why and how is NavHost importing from the same file with 9 versions of the same object, yet no errors? [closed]
BACKGROUND
Hi,
I'm new to Kotlin, Kotlin Multi Platform, and Jetpack Compose, but not a noob to programming. I found a use for a KMP project, and have been working on making a NavGraph and a ...
0
votes
0
answers
88
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
229
views
How to include and play a Lottie animation in Compose Multiplatform?
How can I embed After Effects animations exported with Bodymovin extension as Lottie JSON format in a Compose Multiplatform app (Desktop/Windows/Linux/macOS, Android, iOS, Web/JS/WASM)? Is there a ...
2
votes
1
answer
173
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....
3
votes
1
answer
174
views
fillMaxSize() after rotate() leads to wrong results
The following code gives me output I did not expect.
@Composable
fun App() {
MaterialTheme {
Box(
modifier = Modifier
.fillMaxSize()
.background(...
1
vote
1
answer
60
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,
...
0
votes
0
answers
56
views
Font is not generated in Kotlin multiplartform project
I am trying to create a multimodule KMP project. I have created a module name theme. Inside that I want to define my color, typography and all theme releted code. Now I have created a directory named ...
1
vote
0
answers
41
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
79
views
Compose MissingResourceException in Jar plugin
I've got a compose multiplatform(desktop mainly) project with some UI packed to *.jar
resources config for the feature project
compose.resources {
packageOfResClass = "com.sample.feature"...
0
votes
0
answers
56
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 ...
2
votes
1
answer
87
views
How can I set my iOS AVAudioSession to return input buffers of <0.1 s?
I'm trying to get short audio samples into my iOS app (in Kotlin Multiplatform). Here's my relatively simple setup (sampleRateInHz is defined elsewhere):
val bufferSize: AVAudioFrameCount = 512u
val ...
0
votes
1
answer
202
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
1
answer
706
views
Compose Multiplatform Project (Android Target): Resources not working in module
Full reproducible example here
I'm working on a Jetpack Compose Multiplatform project. In my module ui-system, I have a drawable located at:
ui-system/src/commonMain/composeResources/drawable/compose-...
1
vote
0
answers
76
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 = ...
1
vote
1
answer
72
views
What is the difference between application() and awaitApplication() in Compose Multiplatform Desktop?
There are two functions to be used as the entry point for a CMP desktop application:
fun
usage
application()
fun main() = application { ... }
awaitApplication()
suspend fun main() = awaitApplication { ...
2
votes
1
answer
242
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
43
views
Kotlin/Compose Multiplatform: ClassCastException while running web app
I am developing an application using Kotlin and Compose Multiplatform. The Android and iOS versions work correctly, but the web application displays a blank screen.
Here is the content of Main.kt ...
0
votes
0
answers
88
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
82
views
Getting Each 'every' block requires single mock call! dev.mokkery.internal.NotSingleCallInEveryBlockException:
I am using Mockery lib for mocking in my Kotlin Multiplatform project. Even though I am using a mock instance; I am getting the error:
Each 'every' block requires single mock call! dev.mokkery....
0
votes
0
answers
60
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 ...
1
vote
0
answers
75
views
How to build klib using C++ in Kotlin multiplatform and import it into a regular project for use?
I have some code that needs to be completed in C++, and I hope to compile the C++ code into some form of dynamic library or klib, which can then be used in the Kotlin multiplatform project or as a ...
0
votes
1
answer
113
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
...
0
votes
2
answers
105
views
Get the last version of my app from App store in kotlin multiplatform
I want to check if there is an update on App Store for the app. To do so, I need to get the last version of the app in App Store.
For android (it's working fine):
actual class AppUpdateManager(private ...
1
vote
1
answer
256
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-
...
2
votes
1
answer
110
views
How, in Compose, set the size of an element to a specific children's size?
The setup
In Jetpack Compose, I have a Column (gray) with two elements, a long text (yellow) and a short text (cyan):
@Composable
@Preview
fun Foo() = Column(
Modifier
.background(Color....