Skip to content

Swift 6.2 Android SDK: zlib linking failure in libFoundationXML.so #12

@leogdion

Description

@leogdion

Description

Swift 6.2 Android SDK has a regression where libFoundationXML.so fails to find zlib symbols at runtime, causing any code using FoundationXML (XMLParser, XMLDocument, etc.) to crash.

Swift 6.1 works fine with the same code and configuration.

Environment

  • Swift Version: 6.2 (release)
  • Android API Level: 28 (also tested 33, 34)
  • Architecture: x86_64 (ubuntu-latest runner)
  • Action Version: skiptools/swift-android-action@v2
  • Runner: GitHub Actions ubuntu-latest

Error

CANNOT LINK EXECUTABLE "./SyndiKitPackageTests.xctest":
cannot locate symbol "deflateInit2_" referenced by
"/data/local/tmp/android-xctest/libFoundationXML.so"

The symbol deflateInit2_ is part of zlib, which libxml2 depends on.

Reproduction

Test repository: brightdigit/SyndiKit

  • Branch: test-android-swift-versions
  • Uses XMLCoder package which depends on FoundationXML

Minimal workflow that reproduces:

```yaml

  • uses: skiptools/swift-android-action@v2
    with:
    swift-version: "6.2"
    android-api-level: 28
    run-tests: true
    ```

Any Swift package using FoundationXML will fail.

Verification

Created test branch comparing Swift 6.1 vs 6.2:

  • ✅ Swift 6.1: All tests pass
  • ❌ Swift 6.2: Fails with zlib linking error

CI runs:

Expected Behavior

Swift 6.2 should include zlib (libz.so) in the Android SDK or ensure libFoundationXML.so is statically linked with zlib, matching the behavior of Swift 6.1.

Workaround

Temporarily using Swift 6.1 for Android builds until this is resolved.

Additional Context


Repository affected: brightdigit/SyndiKit
Test branch: test-android-swift-versions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions