iOS Release build fails with 'unsupported Swift architecture' error in version 6.17.7
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
- Create an Expo project with Swift AppDelegate (default in Expo SDK 53+)
- Install
[email protected] - Run
expo prebuild --clean --platform ios - 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.
👋 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.
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
@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
Any update on this issue?
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...
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!
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 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
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.
Same issue here.. The build is failing in debug mode when building for ios simulators.
+1
@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.
I just deleted the file and re-installed pods after this. Re-built the app, works fine now! :)
+1
+1
+1
+1
+1
Fixed in v6.17.8
Commenting here for more eyes. v6.17.8 is still broken for expo. I get the following error
cannot find 'AppsFlyerAttribution' in scope
@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.
@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;