appsflyer-react-native-plugin icon indicating copy to clipboard operation
appsflyer-react-native-plugin copied to clipboard

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

Open steve-rodri opened this issue 2 months ago • 18 comments

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 #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.

steve-rodri avatar Nov 08 '25 09:11 steve-rodri

👋 Hi @steve-rodri and Thank you for opening this issue. Please contact AppsFlyer support through the Customer Assistant Chatbot for assistance with troubleshooting issues or product guidance. To do so, please follow this article.

github-actions[bot] avatar Nov 08 '25 09:11 github-actions[bot]

Getting the same bug.

I chucked the changelog into Claude https://github.com/AppsFlyerSDK/appsflyer-react-native-plugin/compare/6.17.5...6.17.7 and it said:

I understand the issue. The file has a preprocessor check that only allows arm64 architecture, but iOS simulators need support for x86_64 (Intel simulators) and potentially arm64 for Apple Silicon simulators. The fix is to modify the architecture check to support simulator architectures.

This patch-package worked for us

diff --git a/node_modules/react-native-appsflyer/ios/AppsFlyerLib-Swift.h b/node_modules/react-native-appsflyer/ios/AppsFlyerLib-Swift.h
index 091899e..fc9140b 100644
--- a/node_modules/react-native-appsflyer/ios/AppsFlyerLib-Swift.h
+++ b/node_modules/react-native-appsflyer/ios/AppsFlyerLib-Swift.h
@@ -1,6 +1,8 @@
 #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)
+#elif defined(__x86_64__) && __x86_64__
+// x86_64 support for iOS simulator
 #ifndef APPSFLYERLIB_SWIFT_H
 #define APPSFLYERLIB_SWIFT_H
 #pragma clang diagnostic push


OwenMelbz avatar Nov 10 '25 14:11 OwenMelbz

@al-af @amit-kremer93 Please delete this build file, all of your lib consumers with the __x86_64__ arch are getting build crashes. Committed build files cannot pass on code review, it has been 3 weeks without a fix.

Thanks

xavi-999 avatar Nov 13 '25 10:11 xavi-999

Any update on this issue?

Makhdoom-Sharif avatar Nov 19 '25 13:11 Makhdoom-Sharif

Yep this is the same on Expo / EAS:

❌  (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 | 

fix needed...

vonkanehoffen avatar Nov 20 '25 14:11 vonkanehoffen

Getting the same bug.

I chucked the changelog into Claude 6.17.5...6.17.7 and it said:

I understand the issue. The file has a preprocessor check that only allows arm64 architecture, but iOS simulators need support for x86_64 (Intel simulators) and potentially arm64 for Apple Silicon simulators. The fix is to modify the architecture check to support simulator architectures.

This patch-package worked for us

diff --git a/node_modules/react-native-appsflyer/ios/AppsFlyerLib-Swift.h b/node_modules/react-native-appsflyer/ios/AppsFlyerLib-Swift.h index 091899e..fc9140b 100644 --- a/node_modules/react-native-appsflyer/ios/AppsFlyerLib-Swift.h +++ b/node_modules/react-native-appsflyer/ios/AppsFlyerLib-Swift.h @@ -1,6 +1,8 @@ #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) +#elif defined(x86_64) && x86_64 +// x86_64 support for iOS simulator #ifndef APPSFLYERLIB_SWIFT_H #define APPSFLYERLIB_SWIFT_H #pragma clang diagnostic push

Wouldnt this patch make the entire file not usable?

also update on this @al-af ? Would be helpful if we can get the changelog for 6.17.7 and anything breaking changes. Thanks!

Lucienzera avatar Nov 24 '25 10:11 Lucienzera

Umm.... so anyone got any good alternatives to appsflyer for deferred deep linking then? No fix in sight so looks like we're gonna have to swap to something else 😓

vonkanehoffen avatar Nov 26 '25 16:11 vonkanehoffen

@vonkanehoffen just delete the AppsFlyerLib-Swift.h , let your machine generate it instead. Your build will work. I have submitted the fix for this at #660

xavi-999 avatar Nov 26 '25 16:11 xavi-999

Thanks for the tip @xavi-999 but I'm not sure that's even possible in an Expo managed workflow sadly ... unless you know something I don't.

vonkanehoffen avatar Dec 02 '25 09:12 vonkanehoffen

Same issue here.. The build is failing in debug mode when building for ios simulators.

simonadenic avatar Dec 02 '25 13:12 simonadenic

+1

vladanmikic avatar Dec 02 '25 13:12 vladanmikic

@vonkanehoffen have you tried using a patch like the one shown above on the thread? Any approach will work as long as you delete the corrupt build file and let your machine build your own.

xavi-999 avatar Dec 02 '25 14:12 xavi-999

I just deleted the file and re-installed pods after this. Re-built the app, works fine now! :)

simonadenic avatar Dec 02 '25 14:12 simonadenic

+1

pridedev22 avatar Dec 10 '25 05:12 pridedev22

+1

shantanuIngle avatar Dec 10 '25 15:12 shantanuIngle

+1

HarshitMadhav avatar Dec 12 '25 12:12 HarshitMadhav

+1

walterholohan avatar Dec 15 '25 13:12 walterholohan

+1

joshjo-nsuslab avatar Dec 16 '25 05:12 joshjo-nsuslab

Fixed in v6.17.8

al-af avatar Dec 29 '25 13:12 al-af

Commenting here for more eyes. v6.17.8 is still broken for expo. I get the following error

cannot find 'AppsFlyerAttribution' in scope

arapocket avatar Jan 05 '26 06:01 arapocket

@vonkanehoffen have you tried using a patch like the one shown above on the thread? Any approach will work as long as you delete the corrupt build file and let your machine build your own.

Tried this, but now, it can't find the file itself. Is there a way to force the file gen process.

abhi-zanskar avatar Jan 06 '26 11:01 abhi-zanskar

@arapocket - thanks for the heads up! Unfortunately they do not pay attention to the issues here - the only way to get the support is to send them email;

susslik avatar Jan 07 '26 13:01 susslik