Skip to content

iOS Release build fails with 'unsupported Swift architecture' error in version 6.17.7 #656

@steve-rodri

Description

@steve-rodri

Bug Report: Unsupported Swift Architecture Error in [email protected]

Summary

Version 6.17.7 of react-native-appsflyer introduces a regression that causes iOS Release builds to fail with the error: unsupported Swift architecture.

Environment

  • Package: react-native-appsflyer
  • Broken Version: 6.17.7 (published October 22, 2025)
  • Working Versions: 6.17.2, 6.17.5
  • Platform: iOS
  • Build Configuration: Release mode
  • Framework: Expo SDK 54
  • React Native: 0.81.5
  • Xcode: 26.1 (Build version 17B55)
  • macOS: Darwin 25.0.0

Steps to Reproduce

  1. Create an Expo project with Swift AppDelegate (default in Expo SDK 53+)
  2. Install [email protected]
  3. Run expo prebuild --clean --platform ios
  4. Run expo run:ios --configuration Release

Expected Behavior

The iOS app should build successfully in Release mode, as it does with versions 6.17.2 and 6.17.5.

Actual Behavior

Build fails with the following error:

❌  (../../node_modules/react-native-appsflyer/ios/AppsFlyerLib-Swift.h:330:2)

  328 |
  329 | #else
> 330 | #error unsupported Swift architecture
      |  ^ unsupported Swift architecture
  331 | #endif
  332 |

Analysis

The AppsFlyerLib-Swift.h file only supports the __arm64__ architecture (line 2 of the header file):

#if 0
#elif defined(__arm64__) && __arm64__
// Generated by Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
...
#else
#error unsupported Swift architecture
#endif

When building in Release mode, the build process appears to be including architectures that AppsFlyer doesn't support, triggering the error.

Version Testing Results

  • 6.17.2 (July 30, 2025) - Works correctly
  • 6.17.5 (September 3, 2025) - Works correctly
  • 6.17.7 (October 22, 2025) - Fails with architecture error

Workaround

Downgrade to version 6.17.5:

npm install [email protected]
# or
bun add [email protected]

Then run:

expo prebuild --clean --platform ios

Additional Context

  • This issue is related to PR feat: add Swift AppDelegate support for expo #624 which added Swift AppDelegate support
  • Version 6.17.7 is not documented in the CHANGELOG.md file
  • The issue only affects Release builds; Debug builds may work
  • This regression blocks developers from using the latest version with Expo SDK 53+ which uses Swift AppDelegate by default

Suggested Fix

Investigate changes made between 6.17.5 and 6.17.7 that might have affected the iOS Swift header generation or architecture support. The issue appears to be specific to how the AppsFlyer SDK's Swift interface is being compiled for different architectures.

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