尝试在 Xcode 中构建到设备时出现以下错误。它在模拟器上运行良好。
Xcode 12.5 和 React Native 0.63.3 我尝试了一个干净的构建。删除并重新安装 Pod
架构 arm64 的未定义符号:
“___cxa_increment_exception_refcount”,引用自:folly::cxxabi_cxa_exception_sans_reserve() in libFlipper-Folly.a(Exception.o) ld:找不到架构 arm64 clang 的符号:错误:链接器命令失败并退出代码 1(使用 -v 查看调用)
附加输出
Ld /Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/appName.app/appName normal (in target 'appName' from project 'appName') cd /Users/username/ Desktop/appName/appName/appName/ios /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios12.0 -isysroot /Applications/Xcode.app/Contents /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS14.5.sdk -L/Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos -L/Applications/Xcode .app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos -L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift-5。0/iphoneos -L/Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/Analytics-L/Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/ Build/Products/Debug-iphoneos/BoringSSL-GRPC -L/Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/CocoaAsyncSocket -L/Users/username/Library/Developer/ Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/DoubleConversion -L/Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Specos/Products/Build/Specosiphone-用户名/库/开发人员/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/FBSDKCoreKit-L/Users/用户名/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/FBSDKLoginKit -L/Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvhrftjpxofoty/ /Debug-iphoneos/FBSDKShareKit -L/Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/FirebaseAuth -L/Users/username/Library/Developer/Xcode/DerivedData/appName -bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/FirebaseCore -L/Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/FirebaseCorenameLiagnos/Users /Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/FirebaseFirestore-L/Users/用户名/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/FirebaseInstallations -L/Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjpxofzhys /Debug-iphoneos/FirebaseMessaging -L/Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/Flipper -L/Users/username/Library/Developer/Xcode/DerivedData/appName -bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/Flipper-Boost-iOSX -L/Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/UserLipperversion /username/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/Flipper-Fmt-L/Users/用户名/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/Flipper-Folly -L/Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvjhrftjpxoftj /Products/Debug-iphoneos/Flipper-Glog -L/Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/Flipper-PeerTalk -L/Users/username/Library/Developer /Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/Flipper-RSocket -L/Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build Kit/ProductLss /Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/Folly-L/Users/用户名/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/GTMSessionFetcher -L/Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvhrftjpxofoty/Build/Products/Debug-iphoneos/GTMSessionFetcher /Debug-iphoneos/GoogleDataTransport -L/Users/username/Library/Developer/Xcode/DerivedData/appName-bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/GoogleUtilities -L/Users/username/Library/Developer/Xcode/DerivedData/appName -bjouqajvpdjdyzhjhrftjpxofoty/Build/Products/Debug-iphoneos/PromisesObjC …
推送通知适用于 Android,但不适用于 iOS。我已经在设备上进行了测试并通过测试飞行,因为不支持模拟器
我已经完成了 iOS 所需的额外设置。
以下是我的 package.json 文件中的相关信息
包.json
"name": "####",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"start": "react-native start",
"test": "jest",
"lint": "eslint ."
},
"dependencies": {
"@react-native-community/async-storage": "*",
"@react-native-community/masked-view": "*",
"@react-native-firebase/analytics": "*",
"@react-native-firebase/app": "*",
"@react-native-firebase/auth": "*",
"@react-native-firebase/firestore": "*",
"@react-native-firebase/messaging": "*",
"prop-types": "*",
"react": "16.13.1",
"react-dom": "^17.0.2",
"react-native": "0.63.4",
"react-native-fbsdk": "*",
"react-native-gesture-handler": "*",
"react-native-reanimated": "^1.0.0-alpha",
"react-native-render-html": "*",
"react-native-safe-area-context": "*",
"react-native-screens": "*",
"react-navigation": "^4.4.4",
"react-navigation-drawer": "^2.7.1",
"react-navigation-stack": "^2.10.4",
"react-navigation-tabs": "^2.11.1",
"typescript": "^4.2.4"
}, …Run Code Online (Sandbox Code Playgroud) ios react-native firebase-cloud-messaging react-native-firebase