swiftlang / swiftlang/swift-android-examples

Android Studio can't run hello-swift-java and can't even build hello-swift-raw-jni-callback

Open
#42 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
568
Forks
40
Avg merge
4h 8m
Merged PRs (30d)
2

Description

  • Android Studio Panda 2 | 2025.3.2
  • swift-6.3.1-RELEASE_android

I've successfully passed the Getting started guide (https://www.swift.org/documentation/articles/swift-sdk-for-android-getting-started.html) and got "Hello world" displayed with adb shell.

hello-swift-java

This one successfully launches in Android Studio's emulator, however, I have a crash right after pressing 'Hash' button.

This is the error I get:
java.lang.UnsatisfiedLinkError: dlopen failed: library "libswiftSwiftOnoneSupport.so" not found: needed by /data/app/~~OEMasveNSuof6R3AuTtcdw==/com.example.hashingapp-X3tFbdIcxjPE9YOOcckWnQ==/base.apk!/lib/x86_64/libSwiftJava.so in namespace classloader-namespace

hello-swift-raw-jni-callback

This one cannot be built:

> Task :hello-swift-raw-jni-callback:dexBuilderDebug UP-TO-DATE
> Task :hello-swift-raw-jni-callback:mergeProjectDexDebug UP-TO-DATE

> Task :hello-swift-raw-jni-callback:swiftBuildArm64Debug FAILED
Warning: Swift resources directory not found at: /Users/mike/Library/org.swift.swiftpm/swift-sdks//swift-6.3-RELEASE_android.artifactbundle/swift-android/swift-resources/usr/lib/swift_static-aarch64/
You may need to install the Swift SDK for Android
Building Swift for Arm64 Debug
Using swiftly: /Users/mike/.swiftly/bin/swiftly
Swift SDK: aarch64-unknown-linux-android28
Building for debugging...
[0/4] Write swift-version--42659FD12B1A1B50.txt
error: emit-module command failed with exit code 1 (use -v to see invocation)
[2/6] Emitting module hello_swift_raw_jni_callback
<unknown>:0: error: unable to load standard library for target 'aarch64-unknown-linux-android28'
[3/6] Compiling hello_swift_raw_jni_callback hello-swift-callback.swift
<unknown>:0: error: unable to load standard library for target 'aarch64-unknown-linux-android28'

> Task :hello-swift-raw-jni-callback:validateSigningDebug UP-TO-DATE
> Task :hello-swift-raw-jni-callback:writeDebugAppMetadata UP-TO-DATE
> Task :hello-swift-raw-jni-callback:writeDebugSigningConfigVersions UP-TO-DATE

[Incubating] Problems report is available at: file:///Volumes/MOE/p/swift-android-examples/build/reports/problems/problems-report.html

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':hello-swift-raw-jni-callback:swiftBuildArm64Debug'.
> Process 'command '/Users/mike/.swiftly/bin/swiftly'' finished with non-zero exit value 1

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights from a Build Scan (powered by Develocity).
> Get more help at https://help.gradle.org.

* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':hello-swift-raw-jni-callback:swiftBuildArm64Debug'.
- - - -
Caused by: org.gradle.process.ProcessExecutionException: Process 'command '/Users/mike/.swiftly/bin/swiftly'' finished with non-zero exit value 1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing hello-swift-java in Android Studio Panda 2 and hello-swift-raw-jni-callback with the listed Swift SDK versions. Inspect the Android Studio crash and the swiftBuildArm64Debug output, especially the missing Swift resources and standard library messages. Done means both examples build successfully and the Hash action runs without the reported native-library crash.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, swift
Domain
build-system, mobile-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
43/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.