I have a Compose Multiplatform project that includ...
# compose-ios
j
I have a Compose Multiplatform project that includes following in
commonMain
in shared module.
Copy code
implementation(compose.components.resources)
The issue I'm seeing is that if I try to build macOS target in Xcode I'm getting following error.
Copy code
Execution failed for task ':shared:syncComposeResourcesForIos'.
Unknown iOS platform: 'macosx'
It seems like that error is coming from https://github.com/JetBrains/compose-multiplatform/blob/master/gradle-plugins/comp[…]tal/uikit/internal/resources/determineIosKonanTargetsFromEnv.kt .....does this mean that it's not possible to include above dependency in
commonMain
if also targeting for example macOS?
👍 1
Using Compose
1.5.0-beta01
btw
d
Are you using Compose native for MacOS ? Why not a stable Compose for Desktop with JVM?
Compose native for MacOS - it is very experimental target.... It may breaks from time to time.
j
In this case I seem to be hitting issue at build time.....seems like compose resources not supported right now for macOS target?
d
Yes, resources are not supported for MacOS Native. You can split modues in the way, there common code between all targets don't contains resources. And resources should be used in module, there MacOS Native are not presented.
👍 1
We don't know exact future of Compose for MacOS Native. From one perspective - JVM works fine. From another - we can achieve some benefits in application size and native MacOS integratons.
z
I’m seeing this issue despite not targeting macosx when trying to set up an iOS app in https://github.com/slackhq/circuit fwiw
j
@Dima Avdeev the other scenario where it might be good to support this is for an otherwise native MacOS SwiftUI client consuming shared Compose code for part of it's UI.
z
It looks like my case was actually because Xcode defaults to targeting macosx too even when you start a new iOS project