Skip to content

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

@kornerr

Description

@kornerr
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions