https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
v

Vladimir Vainer

10/11/2023, 7:19 AM
In KMP Application, if i put some json file in commonMain/resources, i should be able to read it from NSBundle.main? Or there are extra steps involved? Do i need to set something in xcode project? Because right now, the file is not found in the bundle. Also do i need to manually add "commonMain/resources" to the sourceSet resources? Or it's taken care for me automatically?
j

Jeff Lockhart

10/11/2023, 2:12 PM
There's not currently support for embedding resources in a Kotlin Native framework. There's an issue you can follow.
v

Vladimir Vainer

10/11/2023, 2:14 PM
Strangely it works for me anyhow :) It just puts it under compose-resources subfolder on iOS
j

Jeff Lockhart

10/11/2023, 2:14 PM
If you're using Compose Multiplatform, then yes, the framework handles copying resources for you.
v

Vladimir Vainer

10/11/2023, 2:15 PM
Ah, i do not embed resources in the library but in the consuming app
👍 1