React Native 运行错误:“无法构建 iOS 项目。我们运行了“xcodebuild”命令,但它退出并显示错误代码 65”

Bog*_*hok 3 react-native react-native-ios

我\xe2\x80\x99m 尝试使用该npm run ios命令运行我的React Native 项目。\n但由于某些问题,它一次又一次无法运行。\n它打印出的错误消息如下所示。

\n
GetRest@0.0.1 ios /Users/user/Documents/w_space/bo.git/getrest\n\nreact-native run-ios\n\nerror Could not find the following native modules: RNSVG, RNSVG. Did you forget to run "pod install" ?\n\ninfo Found Xcode workspace "GetRest.xcworkspace"\n\ninfo Building (using "xcodebuild -workspace GetRest.xcworkspace -configuration Debug -scheme GetRest -destination id=81866BE1-BBBB-4A67-990A-3B0B8A613075")\n\n.............\n\nerror 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.\n\nCommand line invocation:\n    /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace GetRest.xcworkspace -configuration Debug -scheme GetRest -destination id=81866BE1-BBBB-4A67-990A-3B0B8A613075\n\nnote: Using new build system\n\nnote: Building targets in parallel\n\nnote: Planning build\n\nnote: Using build description from disk\n\nerror: /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\')\n\nerror: /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\')\n\nerror: /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\')\n\nerror: /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\')\n\nwarning: 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\')\n\n\n\n** BUILD FAILED **\n\n\nnpm ERR! code ELIFECYCLE\n\nnpm ERR! errno 1\n\nnpm ERR! GetRest@0.0.1 ios: `react-native run-ios`\n\nnpm ERR! Exit status 1\n\nnpm ERR! \n\nnpm ERR! Failed at the GetRest@0.0.1 ios script.\n\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\n\nnpm ERR! A complete log of this run can be found in:\n\nnpm ERR!     /Users/user/.npm/_logs/2020-08-22T15_35_46_982Z-debug.log\n
Run Code Online (Sandbox Code Playgroud)\n

小智 5

尝试:

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


小智 5

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

react-native init myNewApp --version 0.60.0
Run Code Online (Sandbox Code Playgroud)

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

react-native run-ios
Run Code Online (Sandbox Code Playgroud)