Expo SDK 46 iOS应用构建在fastlane步骤失败求助
Expo SDK 46 iOS构建失败(Fastlane链接错误:FBAEMKit无Bitcode)
升级Expo SDK到46版本后,使用eas build -p ios(含--clear-cache参数)构建iOS应用时,Fastlane阶段在链接环节失败,SDK44/45版本时构建正常。核心错误提示为FBAEMKit.framework不包含Bitcode。
package.json内容
{ "name": "App123", "version": "1.0.0", "main": "node_modules/expo/AppEntry.js", "scripts": { "start": "expo start", "android": "expo start --android", "ios": "expo start --ios", "web": "expo start --web" }, "dependencies": { "@expo/vector-icons": "^13.0.0", "@openspacelabs/react-native-zoomable-view": "^2.0.4", "@react-native-community/datetimepicker": "6.2.0", "@react-native-community/netinfo": "9.3.0", "@react-native-community/slider": "4.2.3", "@react-native-google-signin/google-signin": "^8.0.0", "@react-navigation/bottom-tabs": "^6.4.0", "@react-navigation/drawer": "^6.5.0", "@react-navigation/native": "^6.0.13", "@react-navigation/native-stack": "^6.9.0", "@react-navigation/stack": "^6.3.2", "@stripe/stripe-react-native": "0.13.1", "apisauce": "^2.1.6", "expo": "~46.0.13", "expo-apple-authentication": "^4.3.0", "expo-auth-session": "^3.7.1", "expo-constants": "^13.2.4", "expo-dev-client": "~1.3.1", "expo-document-picker": "^10.3.0", "expo-firebase-recaptcha": "^2.3.0", "expo-font": "^10.2.1", "expo-image-picker": "^13.3.1", "expo-linear-gradient": "^11.4.0", "expo-linking": "^3.2.2", "expo-localization": "^13.1.0", "expo-location": "^14.3.0", "expo-notifications": "^0.16.1", "expo-secure-store": "^11.3.0", "expo-splash-screen": "^0.16.2", "expo-status-bar": "^1.4.0", "expo-tracking-transparency": "^2.3.1", "expo-updates": "^0.14.6", "firebase": "9.9.2", "formik": "^2.2.9", "html-entities": "^2.3.3", "lodash": "^4.17.21", "lottie-react-native": "5.1.3", "mime": "^3.0.0", "moment": "^2.29.4", "qs": "^6.11.0", "react": "18.0.0", "react-native": "0.69.6", "react-native-credit-card-input": "^0.4.1", "react-native-credit-card-input-view": "^0.0.7", "react-native-draggable-flatlist": "^3.1.2", "react-native-fbsdk-next": "^11.0.0", "react-native-geocoding": "^0.5.0", "react-native-gesture-handler": "~2.5.0", "react-native-google-mobile-ads": "^8.2.0", "react-native-maps": "0.31.1", "react-native-phone-number-input": "^2.1.0", "react-native-progress": "^5.0.0", "react-native-razorpay": "^2.2.9", "react-native-read-more-text": "^1.1.2", "react-native-reanimated": "~2.9.1", "react-native-safe-area-context": "4.3.1", "react-native-screens": "~3.15.0", "react-native-svg": "12.3.0", "react-native-webview": "11.23.0", "react-native-youtube-iframe": "^2.2.2", "yup": "^0.32.11" }, "devDependencies": { "@babel/core": "^7.12.9" }, "private": true }
Fastlane错误日志
Executing App123 » Start Packager on http://localhost:8081 › Compiling App123 » ExpoModulesProvider.swift › Compiling App123 » noop-file.swift › Compiling App123 » main.m › Compiling App123 » App123.c › Linking App123 » App123 ❌ ld: '/Users/expo/Library/Developer/Xcode/DerivedData/App123-djegplhkioltttdpxhkjholomhle/Build/Intermediates.noindex/ArchiveIntermediates/App123/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/FBAEMKit/FBAEMKit.framework/FBAEMKit' does not contain bitcode. You must rebuild it with bitcode enabled (Xcode setting ENABLE_BITCODE), obtain an updated library from the vendor, or disable bitcode for this target. file '/Users/expo/Library/Developer/Xcode/DerivedData/App123-djegplhkioltttdpxhkjholomhle/Build/Intermediates.noindex/ArchiveIntermediates/App123/BuildProductsPath/Release-iphoneos/XCFrameworkIntermediates/FBAEMKit/FBAEMKit.framework/FBAEMKit' for architecture arm64 ❌ clang: error: linker command failed with exit code 1 (use -v to see invocation) ▸ ** ARCHIVE FAILED ** ▸ The following build commands failed: ▸ Ld /Users/expo/Library/Developer/Xcode/DerivedData/App123-djegplhkioltttdpxhkjholomhle/Build/Intermediates.noindex/ArchiveIntermediates/App123/InstallationBuildProductsLocation/Applications/App123.app/App123 normal (in target 'App123' from project 'App123') ▸ (1 failure) 2022-11-10 03:21:16.259 xcodebuild[4548:14785] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore 2022-11-10 03:21:16.259 xcodebuild[4548:14785] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore 2022-11-10 03:21:16.334 xcodebuild[4548:14785] XType: failed to connect - Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.fonts was invalidated: failed at lookup with error 3 - No such process." UserInfo={NSDebugDescription=The connection to service named com.apple.fonts was invalidated: failed at lookup with error 3 - No such process.} 2022-11-10 03:21:16.334 xcodebuild[4548:14785] Font server protocol version mismatch (expected:5 got:0), falling back to local fonts 2022-11-10 03:21:16.334 xcodebuild[4548:14785] XType: unable to make a connection to the font daemon! 2022-11-10 03:21:16.334 xcodebuild[4548:14785] XType: XTFontStaticRegistry is enabled as fontd is not available. ** ARCHIVE FAILED ** The following build commands failed: Ld /Users/expo/Library/Developer/Xcode/DerivedData/App123-djegplhkioltttdpxhkjholomhle/Build/Intermediates.noindex/ArchiveIntermediates/App123/InstallationBuildProductsLocation/Applications/App123.app/App123 normal (in target 'App123' from project 'App123') (1 failure) Exit status: 65 +-------------+-------------------------+ | Build environment | +-------------+-------------------------+ | xcode_path | /Applications/Xcode.app | | gym_version | 2.206.1 | | sdk | iPhoneOS15.5.sdk | +-------------+-------------------------+ Looks like fastlane ran into a build/archive error with your project It's hard to tell what's causing the error, so we wrote some guides on how to troubleshoot build and signing issues: https://docs.fastlane.tools/codesigning/getting-started/ Before submitting an issue on GitHub, please follow the guide above and make sure your project is set up correctly. fastlane uses `xcodebuild` commands to generate your binary, you can see the the full commands printed out in yellow in the above log. Make sure to inspect the output above, as usually you'll find more error information there [stderr] [!] Error building the application - see the log above Error: Fastlane build failed with unknown error. See logs for the "Run fastlane" and "Xcode Logs" phases for more information. Fastlane errors in most cases are not printed at the end of the output, so you may not find any useful information in the last lines of output when looking for an error message.
已尝试操作
- 执行
eas build -p ios - 执行
eas build -p ios --clear-cache
解决方案
问题根源是react-native-fbsdk-next@11.0.0依赖的FBAEMKit框架未包含Bitcode,而Expo SDK46默认开启Bitcode检查,可通过以下两种方式解决:
方式1:禁用Bitcode
在项目根目录的eas.json中添加iOS构建配置,明确禁用Bitcode:
{ "build": { "production": { "ios": { "buildConfiguration": "Release", "disableBitcode": true } } } }
方式2:升级react-native-fbsdk-next
将react-native-fbsdk-next升级到v12.0.0及以上版本,新版本的Facebook SDK框架已修复Bitcode缺失问题。修改package.json中的依赖版本后,执行npm install或yarn install更新依赖,再重新触发构建。
最后步骤
执行eas build -p ios --clear-cache清理缓存后重新构建,验证问题是否解决。
内容的提问来源于stack exchange,提问作者Habibur Rahman
相关产品推荐
相关产品推荐

