我正在尝试使用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
答案 0 :(得分:1)
尝试:
cd ios && pod repo update && pod install && pod update
答案 1 :(得分:0)
我发现的唯一解决方案是创建一个新的RN项目,但版本为60。例如:
react-native init myNewApp --version 0.60.0
然后转到您的项目文件夹并运行
react-native run-ios