React Native ios 构建突然失败

Posted

技术标签:

【中文标题】React Native ios 构建突然失败【英文标题】:React Native ios builds failing suddenly 【发布时间】:2021-05-13 22:29:49 【问题描述】:

我已经从事 React Native 项目大约一年了,突然我的项目失败了。我已经尝试解决这个问题两天了,我真的很茫然。我已经清理了缓存,清理了派生数据,删除了 node_modules,pod deintegrate 等等。有人有什么建议吗?下面是react-native info的输出,下面是Xcode的错误日志:

    OS: macOS 11.2
    CPU: (8) x64 Apple M1
    Memory: 89.19 MB / 16.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 15.12.0 - /usr/local/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 7.6.3 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.10.1 - /Users/ptenteromano/.rvm/rubies/ruby-2.4.1/bin/pod
  SDKs:
    ios SDK:
      Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
    android SDK:
      API Levels: 29
      Build Tools: 28.0.3, 29.0.2, 30.0.3, 31.0.0
      System Images: android-29 | Intel x86 Atom_64, android-29 | Google Play Intel x86 Atom
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.7042882
    Xcode: 12.5/12E262 - /usr/bin/xcodebuild
  Languages:
    Java: 11.0.10 - /Library/Java/JavaVirtualMachines/jdk-11.0.10.jdk/Contents/Home/bin/javac
  npmPackages:
    @react-native-community/cli: Not Found
    react: 17.0.1 => 17.0.1 
    react-native: 0.64.1 => 0.64.1 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found

这是来自 Xcode 的错误日志:

Showing All Errors Only

Build target react-native-safe-area-context of project Pods with configuration Debug

Ld /Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/react-native-safe-area-context/react_native_safe_area_context.framework/react_native_safe_area_context normal (in target 'react-native-safe-area-context' from project 'Pods')
    cd /Users/ptenteromano/Code/surfoto/ios/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios12.0-simulator -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk -L/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/react-native-safe-area-context -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/react-native-safe-area-context -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/DoubleConversion -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/FBReactNativeSpec -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/Folly -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/RCTTypeSafety -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-Core -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTAnimation -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTBlob -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTImage -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTLinking -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTNetwork -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTSettings -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTText -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTVibration -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-cxxreact -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-jsi -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-jsiexecutor -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-jsinspector -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/ReactCommon -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/Yoga -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/glog -filelist /Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-safe-area-context.build/Objects-normal/x86_64/react_native_safe_area_context.LinkFileList -install_name @rpath/react_native_safe_area_context.framework/react_native_safe_area_context -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-safe-area-context.build/Objects-normal/x86_64/react_native_safe_area_context_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -framework Foundation -Xlinker -no_adhoc_codesign -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-safe-area-context.build/Objects-normal/x86_64/react_native_safe_area_context_dependency_info.dat -o /Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/react-native-safe-area-context/react_native_safe_area_context.framework/react_native_safe_area_context

Undefined symbols for architecture x86_64:
  "_RCTConvertMultiEnumValue", referenced from:
      +[RCTConvert(RNCSafeAreaView) RNCSafeAreaViewEdges:] in RNCSafeAreaViewEdges.o
      +[RCTConvert(RNCSafeAreaView) RNCSafeAreaViewMode:] in RNCSafeAreaViewMode.o
  "__RCTNotImplementedException", referenced from:
      -[RNCSafeAreaView initWithCoder:] in RNCSafeAreaView.o
      -[RNCSafeAreaView initWithFrame:] in RNCSafeAreaView.o
  "__RCTAssertFormat", referenced from:
      -[RNCSafeAreaShadowView setLocalData:] in RNCSafeAreaShadowView.o
  "_OBJC_CLASS_$_RCTView", referenced from:
      _OBJC_CLASS_$_RNCSafeAreaProvider in RNCSafeAreaProvider.o
      _OBJC_CLASS_$_RNCSafeAreaView in RNCSafeAreaView.o
  "_OBJC_CLASS_$_RCTViewManager", referenced from:
      _OBJC_CLASS_$_RNCSafeAreaProviderManager in RNCSafeAreaProviderManager.o
      _OBJC_CLASS_$_RNCSafeAreaViewManager in RNCSafeAreaViewManager.o
  "_OBJC_METACLASS_$_RCTShadowView", referenced from:
      _OBJC_METACLASS_$_RNCSafeAreaShadowView in RNCSafeAreaShadowView.o
  "_OBJC_METACLASS_$_RCTViewManager", referenced from:
      _OBJC_METACLASS_$_RNCSafeAreaProviderManager in RNCSafeAreaProviderManager.o
      _OBJC_METACLASS_$_RNCSafeAreaViewManager in RNCSafeAreaViewManager.o
  "_OBJC_CLASS_$_RCTShadowView", referenced from:
      _OBJC_CLASS_$_RNCSafeAreaShadowView in RNCSafeAreaShadowView.o
  "_OBJC_CLASS_$_RCTConvert", referenced from:
      __OBJC_$_CATEGORY_RCTConvert_$_RNCSafeAreaView in RNCSafeAreaViewEdges.o
      __OBJC_$_CATEGORY_RCTConvert_$_RNCSafeAreaView in RNCSafeAreaViewMode.o
  "_RCTRegisterModule", referenced from:
      +[RNCSafeAreaProviderManager load] in RNCSafeAreaProviderManager.o
      +[RNCSafeAreaViewManager load] in RNCSafeAreaViewManager.o
  "_OBJC_METACLASS_$_RCTView", referenced from:
      _OBJC_METACLASS_$_RNCSafeAreaProvider in RNCSafeAreaProvider.o
      _OBJC_METACLASS_$_RNCSafeAreaView in RNCSafeAreaView.o
  "_RCTScreenScale", referenced from:
      -[RNCSafeAreaProvider invalidateSafeAreaInsets] in RNCSafeAreaProvider.o
      -[RNCSafeAreaView invalidateSafeAreaInsets] in RNCSafeAreaView.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Build target react-native-maps of project Pods with configuration Debug

Ld /Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/react-native-maps/react_native_maps.framework/react_native_maps normal (in target 'react-native-maps' from project 'Pods')
    cd /Users/ptenteromano/Code/surfoto/ios/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios12.0-simulator -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk -L/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/react-native-maps -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/react-native-maps -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/DoubleConversion -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/FBReactNativeSpec -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/Folly -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/RCTTypeSafety -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-Core -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTAnimation -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTBlob -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTImage -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTLinking -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTNetwork -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTSettings -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTText -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTVibration -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-cxxreact -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-jsi -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-jsiexecutor -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-jsinspector -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/ReactCommon -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/Yoga -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/glog -filelist /Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-maps.build/Objects-normal/x86_64/react_native_maps.LinkFileList -install_name @rpath/react_native_maps.framework/react_native_maps -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-maps.build/Objects-normal/x86_64/react_native_maps_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -framework Foundation -Xlinker -no_adhoc_codesign -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/react-native-maps.build/Objects-normal/x86_64/react_native_maps_dependency_info.dat -o /Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/react-native-maps/react_native_maps.framework/react_native_maps

Undefined symbols for architecture x86_64:
  "_RCTScreenScale", referenced from:
      -[AIRMapMarker setImageSrc:] in AIRMapMarker.o
      -[AIRMapOverlay setImageSrc:] in AIRMapOverlay.o
  "_RCTConvertArrayValue", referenced from:
      +[RCTConvert(AirMap) AIRMapCoordinateArray:] in RCTConvert+AirMap.o
      +[RCTConvert(AirMap) AIRMapCoordinateArrayArray:] in RCTConvert+AirMap.o
  "_OBJC_CLASS_$_RCTConvert", referenced from:
      objc-class-ref in AIRMapManager.o
      objc-class-ref in AIRMapMarker.o
      objc-class-ref in AIRMapOverlay.o
      objc-class-ref in RCTConvert+AirMap.o
      __OBJC_$_CATEGORY_RCTConvert_$_AirMap in RCTConvert+AirMap.o
  "_RCTConvertEnumValue", referenced from:
      +[RCTConvert(AirMap) MKMapType:] in RCTConvert+AirMap.o
  "__RCTLogNativeInternal", referenced from:
      ___52-[AIRMapManager getMapBoundaries:resolver:rejecter:]_block_invoke in AIRMapManager.o
      ___34-[AIRMapManager setCamera:camera:]_block_invoke in AIRMapManager.o
      ___55-[AIRMapManager animateCamera:withCamera:withDuration:]_block_invoke in AIRMapManager.o
      ___83-[AIRMapManager animateToNavigation:withRegion:withBearing:withAngle:withDuration:]_block_invoke in AIRMapManager.o
      ___57-[AIRMapManager animateToRegion:withRegion:withDuration:]_block_invoke in AIRMapManager.o
      ___61-[AIRMapManager animateToCoordinate:withRegion:withDuration:]_block_invoke in AIRMapManager.o
      ___62-[AIRMapManager animateToViewingAngle:withAngle:withDuration:]_block_invoke in AIRMapManager.o
      ...
  "_OBJC_CLASS_$_RCTViewManager", referenced from:
      _OBJC_CLASS_$_AIRMapCalloutManager in AIRMapCalloutManager.o
      _OBJC_CLASS_$_AIRMapCalloutSubviewManager in AIRMapCalloutSubviewManager.o
      _OBJC_CLASS_$_AIRMapCircleManager in AIRMapCircleManager.o
      _OBJC_CLASS_$_AIRMapLocalTileManager in AIRMapLocalTileManager.o
      _OBJC_CLASS_$_AIRMapManager in AIRMapManager.o
      _OBJC_CLASS_$_AIRMapMarkerManager in AIRMapMarkerManager.o
      _OBJC_CLASS_$_AIRMapOverlayManager in AIRMapOverlayManager.o
      ...
  "_OBJC_METACLASS_$_RCTViewManager", referenced from:
      _OBJC_METACLASS_$_AIRMapCalloutManager in AIRMapCalloutManager.o
      _OBJC_METACLASS_$_AIRMapCalloutSubviewManager in AIRMapCalloutSubviewManager.o
      _OBJC_METACLASS_$_AIRMapCircleManager in AIRMapCircleManager.o
      _OBJC_METACLASS_$_AIRMapLocalTileManager in AIRMapLocalTileManager.o
      _OBJC_METACLASS_$_AIRMapManager in AIRMapManager.o
      _OBJC_METACLASS_$_AIRMapMarkerManager in AIRMapMarkerManager.o
      _OBJC_METACLASS_$_AIRMapOverlayManager in AIRMapOverlayManager.o
      ...
  "_OBJC_METACLASS_$_RCTView", referenced from:
      _OBJC_METACLASS_$_AIRMapCallout in AIRMapCallout.o
  "_RCTRegisterModule", referenced from:
      +[AIRMapCalloutManager load] in AIRMapCalloutManager.o
      +[AIRMapCalloutSubviewManager load] in AIRMapCalloutSubviewManager.o
      +[AIRMapCircleManager load] in AIRMapCircleManager.o
      +[AIRMapLocalTileManager load] in AIRMapLocalTileManager.o
      +[AIRMapManager load] in AIRMapManager.o
      +[AIRMapMarkerManager load] in AIRMapMarkerManager.o
      +[AIRMapOverlayManager load] in AIRMapOverlayManager.o
      ...
  "_OBJC_CLASS_$_RCTView", referenced from:
      _OBJC_CLASS_$_AIRMapCallout in AIRMapCallout.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)


Build target RNScreens of project Pods with configuration Debug

Ld /Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/RNScreens/RNScreens.framework/RNScreens normal (in target 'RNScreens' from project 'Pods')
    cd /Users/ptenteromano/Code/surfoto/ios/Pods
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-ios12.0-simulator -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.5.sdk -L/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/RNScreens -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/RNScreens -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/DoubleConversion -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/FBReactNativeSpec -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/Folly -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/RCTTypeSafety -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-Core -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTAnimation -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTBlob -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTImage -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTLinking -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTNetwork -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTSettings -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTText -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-RCTVibration -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-cxxreact -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-jsi -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-jsiexecutor -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/React-jsinspector -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/ReactCommon -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/Yoga -F/Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/glog -filelist /Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNScreens.build/Objects-normal/x86_64/RNScreens.LinkFileList -install_name @rpath/RNScreens.framework/RNScreens -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNScreens.build/Objects-normal/x86_64/RNScreens_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -framework Foundation -Xlinker -no_adhoc_codesign -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/RNScreens.build/Objects-normal/x86_64/RNScreens_dependency_info.dat -o /Users/ptenteromano/Library/Developer/Xcode/DerivedData/com.surfoto-erltcbqujwkqrfamxcnqoklzkkht/Build/Products/Debug-iphonesimulator/RNScreens/RNScreens.framework/RNScreens

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_RCTFont", referenced from:
      objc-class-ref in RNSScreenStackHeaderConfig.o
  "_RCTIsMainQueue", referenced from:
      -[RNSScreenContainerManager markUpdated:] in RNSScreenContainer.o
  "__RCTAssertFormat", referenced from:
      -[RNSScreenContainerManager markUpdated:] in RNSScreenContainer.o
      -[RNSScreenStackView setModalViewControllers:] in RNSScreenStack.o
  "_OBJC_CLASS_$_RCTRootContentView", referenced from:
      objc-class-ref in RNSScreenStack.o
  "_RCTRegisterModule", referenced from:
      +[RNSScreenManager load] in RNSScreen.o
      +[RNSScreenContainerManager load] in RNSScreenContainer.o
      +[RNSScreenStackManager load] in RNSScreenStack.o
      +[RNSScreenStackHeaderConfigManager load] in RNSScreenStackHeaderConfig.o
      +[RNSScreenStackHeaderSubviewManager load] in RNSScreenStackHeaderConfig.o
  "_OBJC_CLASS_$_RCTConvert", referenced from:
      __OBJC_$_CATEGORY_RCTConvert_$_RNSScreen in RNSScreen.o
      __OBJC_$_CATEGORY_RCTConvert_$_RNSScreenStackHeader in RNSScreenStackHeaderConfig.o
  "_OBJC_CLASS_$_RCTRootView", referenced from:
      objc-class-ref in RNSScreen.o
  "_OBJC_METACLASS_$_RCTViewManager", referenced from:
      _OBJC_METACLASS_$_RNSScreenManager in RNSScreen.o
      _OBJC_METACLASS_$_RNSScreenContainerManager in RNSScreenContainer.o
      _OBJC_METACLASS_$_RNSScreenStackManager in RNSScreenStack.o
      _OBJC_METACLASS_$_RNSScreenStackHeaderConfigManager in RNSScreenStackHeaderConfig.o
      _OBJC_METACLASS_$_RNSScreenStackHeaderSubviewManager in RNSScreenStackHeaderConfig.o
  "_OBJC_METACLASS_$_RCTView", referenced from:
      _OBJC_METACLASS_$_RNSScreenView in RNSScreen.o
  "_RCTExecuteOnMainQueue", referenced from:
      -[RNSScreenContainerManager markUpdated:] in RNSScreenContainer.o
  "_OBJC_CLASS_$_RCTTouchHandler", referenced from:
      objc-class-ref in RNSScreen.o
  "_OBJC_CLASS_$_RCTView", referenced from:
      _OBJC_CLASS_$_RNSScreenView in RNSScreen.o
  "_OBJC_CLASS_$_RCTViewManager", referenced from:
      _OBJC_CLASS_$_RNSScreenManager in RNSScreen.o
      _OBJC_CLASS_$_RNSScreenContainerManager in RNSScreenContainer.o
      _OBJC_CLASS_$_RNSScreenStackManager in RNSScreenStack.o
      _OBJC_CLASS_$_RNSScreenStackHeaderConfigManager in RNSScreenStackHeaderConfig.o
      _OBJC_CLASS_$_RNSScreenStackHeaderSubviewManager in RNSScreenStackHeaderConfig.o
  "_RCTConvertEnumValue", referenced from:
      +[RCTConvert(RNSScreen) RNSScreenStackPresentation:] in RNSScreen.o
      +[RCTConvert(RNSScreen) RNSScreenStackAnimation:] in RNSScreen.o
      +[RCTConvert(RNSScreen) RNSScreenReplaceAnimation:] in RNSScreen.o
      +[RCTConvert(RNSScreenStackHeader) RNSScreenStackHeaderSubviewType:] in RNSScreenStackHeaderConfig.o
      +[RCTConvert(RNSScreenStackHeader) UIBlurEffectStyle:] in RNSScreenStackHeaderConfig.o
  "__RCTLogNativeInternal", referenced from:
      -[RNSScreenView setStackPresentation:] in RNSScreen.o
      -[RNSScreenStackView insertReactSubview:atIndex:] in RNSScreenStack.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)



Build failed    5/13/21, 6:14 PM    156.7 seconds

【问题讨论】:

找到解决办法了吗? 【参考方案1】:

在我看来,您似乎使用了不同的方式在项目中安装您的 pod,一些用于 arch arm64,一些用于 arch x86_64,这会导致此问题。

在我遇到这个问题后,它只有助于创建一个新的 RN 项目,复制文件,然后始终使用:

arch -x86_64 pod 安装

并在 Xcode 的构建设置中禁用 arm64。

不幸的是,我自己仍在为谷歌地图包而苦苦挣扎。

更多信息请看这里Some tips to working with react-native 0.64 on an Apple M1 Silicon chip

【讨论】:

以上是关于React Native ios 构建突然失败的主要内容,如果未能解决你的问题,请参考以下文章

构建失败:如何解决 React Native iOS 虚拟设备应用构建失败、CompileSwift 和 CompileC 失败?

React Native iOS构建失败

在 Mac M1 上 React Native ios 构建失败

React Native 和 RNFirebase iOS 版本构建失败

React Native iOS 构建失败“无法执行命令:分段错误:11”

Facebook SDK 导致 React Native 构建失败