xcode 错误 无法构建 iOS 项目。我们运行了“xcodebuild”命令,但它以错误代码 65 退出
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/55235825/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65
提问by Idan Asulin
I've build a react-native application and suddenly I get this error message on my terminal during run of the command react-native run-ios. The same code work fine 10 minutes ago and suddenly I get this error message. Please help...
我已经构建了一个 react-native 应用程序,但在运行命令 react-native run-ios 期间,我突然在终端上收到此错误消息。相同的代码在 10 分钟前工作正常,突然我收到此错误消息。请帮忙...
采纳答案by Akshay Mulgavkar
SOLVED:Always be sure to update your Xcode folks!
已解决:请务必更新您的 Xcode 人员!
Protip:And don't do it from the apple store (but always do it from an official apple website of course)
提示:不要在苹果商店做(但一定要从苹果官方网站上做)
tip from:http://ericasadun.com/2016/03/22/xcode-upgrades-lessons-learned/
提示来自:http : //ericasadun.com/2016/03/22/xcode-upgrades-lessons-learned/
official apple download page:https://developer.apple.com/download/more/
苹果官方下载页面:https : //developer.apple.com/download/more/
For those who are unable to resolve with above method
对于以上方法无法解决的人
Go to project settings in Xcode. Menu File->Project Settings
Go to per-User Project Settings section.
Click on advanced.
Select Xcode Default option. previously this used to be Legacy for my project.
转到 Xcode 中的项目设置。菜单文件->项目设置
转到每用户项目设置部分。
点击高级。
选择 Xcode 默认选项。以前这曾经是我项目的遗产。
I have analysed on similar lines and concluded that clean is causing the archive to fail. So, the new build system is not clearing the custom/legacy build directory.
我对类似的线路进行了分析,并得出结论,干净导致存档失败。因此,新的构建系统不会清除 custom/legacy 构建目录。
delete the build/ folder in ios/ and rerun if that doesn't do any change then
File -> Project Settings (or WorkSpace Settings) -> Build System -> Legacy Build System
Rerun and voilà!
If it still Fails you need to clean full project
如果仍然失败,您需要清理整个项目
Do the following:
请执行下列操作:
- Delete ios dir manually
- Clean cache Run
npm cache clean --force
- Run
react-native eject
- Re-install all packages
npm install
- Run the link command
react-native link
- Finally run
react-native run-ios
- 手动删除ios目录
- 清理缓存运行
npm cache clean --force
- 跑
react-native eject
- 重新安装所有软件包
npm install
- 运行链接命令
react-native link
- 最后运行
react-native run-ios
回答by Nagibaba
- delete the
build/
folder inios/
and rerun if that doesn't do any change then - File -> Project Settings (or WorkSpace Settings) -> Build System -> Legacy Build System
- Rerun and voilà!
- 删除
build/
文件夹ios/
并重新运行,如果没有做任何更改然后 - 文件 -> 项目设置(或工作区设置) -> 构建系统 -> 传统构建系统
- 重新运行,瞧!
In case this doesn't work, don't be sad, there is another solution to deeply clean project
如果这不起作用,请不要难过,还有另一种深度清洁项目的解决方案
Delete
ios/
andandroid/
folders.Run
react-native eject
Run
react-native link
react-native run-ios
删除
ios/
和android/
文件夹。跑
react-native eject
跑
react-native link
react-native run-ios
This will bring a whole new resurrection for your project
这将为您的项目带来全新的复活
回答by Nana Adjei
If you don't have cocoa pods installed you need to sudo gem install cocoapods
如果你没有安装可可豆荚,你需要 sudo gem install cocoapods
- run
cd ios
- run
pod install
- cd ..
- delete buildfolder
- run
react-native run-ios
- 跑
cd ios
- 跑
pod install
- 光盘..
- 删除构建文件夹
- 跑
react-native run-ios
if error persists,
1. delete build folder again
2. open the /ios
folder in x-code
3. navigate File -> Project Settings -> Build System -> change (Shared workspace settings and Per-User workspace settings): Build System -> Legacy Build System
如果错误仍然存在,1. 再次删除构建文件夹 2./ios
在 x-code 中打开文件夹 3. 导航文件 -> 项目设置 -> 构建系统 -> 更改(共享工作区设置和每用户工作区设置):构建系统 ->传统构建系统
回答by sturdynut
I had the same error, but it was caused by the package manager process port being already used (port 8081).
我有同样的错误,但它是由已使用的包管理器进程端口(端口 8081)引起的。
To fix, I just ran the react-native
by specifying a different port, see below.
为了修复,我只是react-native
通过指定不同的端口来运行,见下文。
react-native run-ios --port 8090
react-native run-ios --port 8090
回答by Dhruv Godara
If you don't have cocoa pods installed you need to:
如果您没有安装可可豆荚,您需要:
sudo gem install cocoapods
Then run:
然后运行:
cd /ios
pod install
delete the build
folder in ios
folder of your react native project
删除反应本机项目build
文件夹中的ios
文件夹
run:
跑:
react-native run-ios
if error persists:
如果错误仍然存在:
- delete
build
folder again - open the
/ios
folder in Xcode - navigate File -> Project Settings -> Build System -> change (Shared workspace settings and Per-User workspace settings): Build System -> Legacy Build System
build
再次删除文件夹/ios
在 Xcode 中打开文件夹- 导航文件 -> 项目设置 -> 构建系统 -> 更改(共享工作区设置和每用户工作区设置):构建系统 -> 传统构建系统
回答by ICeZer0
After upgrading react-native, you may have stale dependencies. The steps below should fix it.
升级 react-native 后,您可能有过时的依赖项。下面的步骤应该修复它。
cd ios
- delete Podfile.lock
pod deintegrate && pod install
- Navigate back to package.json directory
- run
react-native run-ios
- In Xcode you can build your project again too
cd ios
- 删除 Podfile.lock
pod deintegrate && pod install
- 导航回 package.json 目录
- 跑
react-native run-ios
- 在 Xcode 中,您也可以再次构建您的项目
Hope this helps, I did this after upgrading to react-native 0.61
希望这会有所帮助,我在升级到 react-native 0.61
回答by Halalisani Goodpresent
run pod install inside ios folder then go back to root folder and run npx react-native run-ios
在 ios 文件夹中运行 pod install 然后返回根文件夹并运行 npx react-native run-ios
回答by Guilherme Trivilin
What worked for me was to rename the project by removing the special characters.
对我有用的是通过删除特殊字符来重命名项目。
Example: "project_marketplace" to "projectmarketplace"
示例:“project_marketplace”到“projectmarketplace”
In this case, I redid the project with react-native init and copied the src and package.json folder.
在这种情况下,我使用 react-native init 重做项目并复制 src 和 package.json 文件夹。
回答by Azhar Zafar
For me it caused by installing react-native-vector-icons and running the react-native link react-native-vector-icons
command.
对我来说,它是由安装 react-native-vector-icons 并运行react-native link react-native-vector-icons
命令引起的。
I just unlinked the react-native-vector-icons by following commands
我只是通过以下命令取消链接 react-native-vector-icons
react-native unlink react-native-vector-icons
cd ios
pod install
cd ..
react-native run-ios
react-native unlink react-native-vector-icons
cd ios
pod install
cd ..
react-native run-ios
As I already installed an other icon library.
因为我已经安装了其他图标库。