https://kotlinlang.org logo
#compose-ios
Title
# compose-ios
s

Sam Michael

10/18/2023, 1:20 AM
Hi I am trying to create an archive from my project for upload to app store, but the syncComposeForIos:
Could not infer iOS target architectures. Make sure to build via XCode (directly or via Kotlin Multiplatform Mobile plugin for Android Studio)
Error while evaluating property 'xcodeTargetArchs' of task ':shared:syncComposeResourcesForIos'.
How do i debug and resolve this, I've tried respecifying the architectures: My xcode specifies $(ARCHS_STANDARD) and build.gradle.kts has:
iosX64(),
iosArm64(),
iosSimulatorArm64()
This seems to be causing the issue, coming from cocoapods libraries in objective c not being linked properly, I tried adding cocoapods to the build.gradle.kts, (before I was building myself for xcode from command line) but that didn't seem to help. I not sure what to try next to fix
If i build the release version instead of debug this goes away, but still can't build archive
By best guess is to try setting up like this for the unlinked obj c libraries but i didn't think that would be necessary since only using them in my iosApp and not trying to call from shared code or anything like that
export arch\=undefined_arch
Also see this in my shell script but don't know where else i can change to affect this?
Ok i think i have it now, i had warnings for a while about ios deployment target being too low, once i set to ios 14.0 for all my pods and my workspace i was able to create an archive from it!
a

Angga Ardinata

10/18/2023, 3:55 AM
what gradle task you invoke to create an archive from terminal ?
s

Sam Michael

10/20/2023, 2:54 AM
I just using xcode to create archive for any iOS device, my app works fine on a simulator but for archive this task fails, can't release on App Store until it is resolved
Task :shared:syncComposeResourcesForIos FAILED
error: Could not infer iOS target architectures. Make sure to build via XCode (directly or via Kotlin Multiplatform Mobile plugin for Android Studio) FAILURE: Build failed with an exception. * What went wrong: Execution failed for task 'sharedsyncComposeResourcesForIos'.
Error while evaluating property 'xcodeTargetArchs' of task 'sharedsyncComposeResourcesForIos'.
> Could not infer iOS target architectures. Make sure to build via XCode (directly or via Kotlin Multiplatform Mobile plugin for Android Studio) * Try:
Run with --stacktrace option to get the stack trace.
Run with --info or --debug option to get more log output.
Run with --scan to get full insights.
Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/8.2.1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD FAILED in 503ms 1 actionable task: 1 executed
13 Views