React Native run error: “Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65”

React Native run error: “Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65”

我正在尝试使用 npm run ios 命令 运行 我的 React Native 项目。 但由于某些问题,它一次又一次地不起作用。 它打印出的错误信息如下所示。

GetRest@0.0.1 ios /Users/user/Documents/w_space/bo.git/getrest

react-native run-ios

error Could not find the following native modules: RNSVG, RNSVG. Did you forget to run "pod install" ?

info Found Xcode workspace "GetRest.xcworkspace"

info Building (using "xcodebuild -workspace GetRest.xcworkspace -configuration Debug -scheme GetRest -destination id=81866BE1-BBBB-4A67-990A-3B0B8A613075")

.............

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening GetRest.xcworkspace. Run CLI with --verbose flag for more details.

Command line invocation:
    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace GetRest.xcworkspace -configuration Debug -scheme GetRest -destination id=81866BE1-BBBB-4A67-990A-3B0B8A613075

note: Using new build system

note: Building targets in parallel

note: Planning build

note: Using build description from disk

error: /Users/user/Documents/w_space/bo.git/getrest/ios/Pods/Target Support Files/Pods-GetRest/Pods-GetRest.debug.xcconfig: unable to open file (in target "GetRest" in project "GetRest") (in target 'GetRest' from project 'GetRest')

error: /Users/user/Documents/w_space/bo.git/getrest/ios/Pods/Target Support Files/Pods-GetRest/Pods-GetRest.debug.xcconfig: unable to open file (in target "GetRest" in project "GetRest") (in target 'GetRest' from project 'GetRest')

error: /Users/user/Documents/w_space/bo.git/getrest/ios/Pods/Target Support Files/Pods-GetRest/Pods-GetRest.debug.xcconfig: unable to open file (in target "GetRest" in project "GetRest") (in target 'GetRest' from project 'GetRest')

error: /Users/user/Documents/w_space/bo.git/getrest/ios/Pods/Target Support Files/Pods-GetRest/Pods-GetRest.debug.xcconfig: unable to open file (in target "GetRest" in project "GetRest") (in target 'GetRest' from project 'GetRest')

warning: Capabilities for Signing & Capabilities may not function correctly because its entitlements use a placeholder team ID. To resolve this, select a development team in the GetRest editor. (in target 'GetRest' from project 'GetRest')



** BUILD FAILED **


npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! GetRest@0.0.1 ios: `react-native run-ios`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the GetRest@0.0.1 ios script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


npm ERR! A complete log of this run can be found in:

npm ERR!     /Users/user/.npm/_logs/2020-08-22T15_35_46_982Z-debug.log

尝试:

  • 正在删除 Pods 文件夹
  • cd ios && pod repo update && pod install && pod update

我找到的唯一解决方案是创建一个新的 RN 项目,但版本为 60。示例:

react-native init myNewApp --version 0.60.0

然后转到您的项目文件夹并运行

react-native run-ios