Need help
Environment
- Host machine: Apple Silicon Mac (M4 Pro),
arm64-apple-macosx - Tooling:
swiftly 1.1.1- Host toolchain installed via
swiftly:main-snapshot-2026-03-09
- Android SDK bundle instalado via
swift sdk:swift-DEVELOPMENT-SNAPSHOT-2026-03-09-a_android
- Android NDK: 27.3.13750724
($ANDROID_NDK_HOME=/Users/<user>/Library/Android/sdk/ndk/27.3.13750724)
Project
Minimal SwiftPM executable package:
// swift-tools-version: 6.3
import PackageDescription
let package = Package(
name: "hello",
targets: [
.executableTarget(name: "hello"),
.testTarget(name: "helloTests", dependencies: ["hello"]),
],
swiftLanguageModes: [.v6]
)
What I’m trying to do
Build this package for Android ARM64 using the Android SDK bundle and the matching host toolchain:
cd /Volumes/MLI-MK45/Developer/S4A/testes/hello
swiftly run swift build +main-snapshot-2026-03-09 \
--swift-sdk swift-DEVELOPMENT-SNAPSHOT-2026-03-09-a_android \
--triple aarch64-unknown-linux-android24
Evidence that the bundle contains ARM64 libs
Inside the installed SDK bundle I can see swift-aarch64/android:
cd /Users/<user>/Library/org.swift.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2026-03-09-a_android.artifactbundle
ls swift-android/swift-resources/usr/lib/swift-aarch64/android
Output (truncated):
Android.swiftmodule
Swift.swiftmodule
Foundation.swiftmodule
...
libswiftCore.so
libswiftAndroid.so
libswift_Concurrency.so
...
aarch64/
...
So the SDK clearly ships ARM64 modules and .so files for Android.
Actual behavior / error
When I build with --triple aarch64-unknown-linux-android24, the linker still tries to link x86_64 Android libraries:
warning: multiple Swift SDKs match ID `swift-DEVELOPMENT-SNAPSHOT-2026-03-09-a_android` and host triple arm64-apple-macosx, selected one at /Users/<user>/Library/org.swift.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2026-03-09-a_android.artifactbundle/swift-android
[1/1] Planning build
Building for debugging...
error: link command failed with exit code 1 (use -v to see invocation)
ld.lld: error: /Users/<user>/Library/org.swift.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2026-03-09-a_android.artifactbundle/swift-android/swift-resources/usr/lib/swift-x86_64/android/libswiftSwiftOnoneSupport.so is incompatible with aarch64linux
ld.lld: error: /Users/<user>/Library/org.swift.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2026-03-09-a_android.artifactbundle/swift-android/swift-resources/usr/lib/swift-x86_64/android/libswiftCore.so is incompatible with aarch64linux
ld.lld: error: /Users/<user>/Library/org.swift.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2026-03-09-a_android.artifactbundle/swift-android/swift-resources/usr/lib/swift-x86_64/android/libswift_Concurrency.so is incompatible with aarch64linux
ld.lld: error: /Users/<user>/Library/org.swift.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2026-03-09-a_android.artifactbundle/swift-android/swift-resources/usr/lib/swift-x86_64/android/libswift_StringProcessing.so is incompatible with aarch64linux
ld.lld: error: /Users/<user>/Library/org.swift.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2026-03-09-a_android.artifactbundle/swift-android/swift-resources/usr/lib/swift-x86_64/android/libswift_RegexParser.so is incompatible with aarch64linux
ld.lld: error: /Users/<user>/Library/org.swift.swiftpm/swift-sdks/swift-DEVELOPMENT-SNAPSHOT-2026-03-09-a_android.artifactbundle/swift-android/swift-resources/usr/lib/swift-x86_64/android/libswiftCore.so is incompatible with aarch64linux
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[1/2] Linking hello
Note that the paths are all under swift-x86_64/android, even though the target triple is aarch64-unknown-linux-android24 and swift-aarch64/android exists in the bundle.
If I instead build for x86_64-unknown-linux-android24:
swiftly run swift build +main-snapshot-2026-03-09 \
--swift-sdk swift-DEVELOPMENT-SNAPSHOT-2026-03-09-a_android \
--triple x86_64-unknown-linux-android24
the build completes successfully and I can push/run the binary on an x86_64-capable environment.
Expected behavior
Given that:
- The bundle contains ARM64 libraries under
swift-aarch64/android, and - I’m passing
--triple aarch64-unknown-linux-android24,
I would expect the Swift driver/toolchain to:
- Select the aarch64 libraries under
swift-aarch64/android, notswift-x86_64/android, and - Produce a working
aarch64executable suitable for an Android ARM64 device/emulator.
Question
Is this a known issue/limitation of the swift-DEVELOPMENT-SNAPSHOT-2026-03-09-a_android SDK bundle, or am I missing an additional flag/configuration to make the driver pick swift-aarch64/android for aarch64-unknown-linux-android24 on Apple Silicon?
Any guidance or workaround to force the use of the ARM64 libs in this snapshot would be very helpful.