Android SDK snapshot swift-DEVELOPMENT-SNAPSHOT-2026-03-09-a_android links x86_64 libs for aarch64 target on Apple Silicon

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, not swift-x86_64/android, and
  • Produce a working aarch64 executable 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.

I suggest you follow our Getting Started instructions for Android exactly, which you are not here, and that you only install one Android SDK bundle snapshot so that linked command works. The --triple flag you're using instead has always been broken when used with SDK bundles since they were added years ago, in exactly this way for all SDK bundles, I'll have a fix soon.

I also sometimes get a little confused when installing the tool chain.
I just moved to a new machine and tried to follow the guide, but not exactly.
The guide mentions:

swiftly install main-snapshot-2025-12-17

I assume that it is still ok to follow the guide close to exactly, but using a newer build?

If so: is 6.3 or main preferred for stability?

Yes, newer builds are preferred, in fact. We will update those instructions to say that.

Definitely 6.3, which sees a lot less changes compared to the main branch, particularly now that the release is close.

1 Like

I filed a bug a few hours ago—maybe it’s related? macOS arm64: swift-DEVELOPMENT-SNAPSHOT-2026-03-09-a ships x86_64-only bianires, and is unusable on Apple Silicon hosts · Issue #87865 · swiftlang/swift · GitHub