Hello, using `2.4.0-RC-185` and I’m getting this (...
# swift-export
g
Hello, using
2.4.0-RC-185
and I’m getting this (didn’t happen before nor with Beta2):
Copy code
* What went wrong:
Execution failed for task '...:validateArchitecturesForEmbedSwiftExportForXcode' (registered by plugin 'org.jetbrains.kotlin.multiplatform').
> Xcode Requested Architecture Not Configured in Gradle
  Xcode Requested Architecture Not Configured in Gradle
   Xcode requested target architectures that are not configured in your Gradle build: ios_x64.
   The framework 'swiftExport' cannot be built for these target architectures.
Even if I add Xcode configs to skip
x86_64
it fails. Normally I just use
Build Active Architecture Only to YES
and it works fine.
a
Hi. May I ask you to file a ticket for that? This problem is not about Swift Export but about KGP.
👍 1
(I've pinged the responsible team already, but its always easier to have a ticket 🙂 )
g
done 🙂 KT-86142
thank you color 1
a
Hi @Guilherme Delgado, thanks for reporting this issue. I see that you have both Pre-Actions scheme and Run-Script phase configured. Normally you need just Run-Script phase. Please remove Pre-Actions scheme and your issue should be resolved.
g
I have to use pre-actions because I’m using SPM that depend on the xcframework
SPM will try to resolve its dependencies before the Build Phase, which means that packages depending on the
MagicDataLayer
will fail, since the Build Phase only runs after. These situations arise when no build cache exists or if the Derived Data is cleared. We can solve this situation by replicating this Build Phase script in the app’s scheme Build step by adding a Pre-actions Run Script
@Andrey Yastrebov did a quick test without it, and it still fails (no dependencies found) with swiftExport, I need the pre-actions to run.
Screenshot 2026-05-06 at 14.05.37.png
a
Use this as a Pre-Actions script
Copy code
cd "$SRCROOT/.."

# Xcode Scheme Pre-Actions don't subtract EXCLUDED_ARCHS from ARCHS.
# Filter manually so Gradle sees the correct architectures.
for arch in $EXCLUDED_ARCHS; do
    ARCHS="${ARCHS//$arch/}"
done
export ARCHS="$(echo $ARCHS | xargs)"

./gradlew exportFrameworkForXcode
👍 1