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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 18:35:17  来源:igfitidea点击:

error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65

xcodereact-native

提问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

对于以上方法无法解决的人

  1. Go to project settings in Xcode. Menu File->Project Settings

  2. Go to per-User Project Settings section.

  3. Click on advanced.

  4. Select Xcode Default option. previously this used to be Legacy for my project.

  1. 转到 Xcode 中的项目设置。菜单文件->项目设置

  2. 转到每用户项目设置部分。

  3. 点击高级。

  4. 选择 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

  1. delete the build/folder in ios/and rerun if that doesn't do any change then
  2. File -> Project Settings (or WorkSpace Settings) -> Build System -> Legacy Build System
  3. Rerun and voilà!
  1. 删除build/文件夹ios/并重新运行,如果没有做任何更改然后
  2. 文件 -> 项目设置(或工作区设置) -> 构建系统 -> 传统构建系统
  3. 重新运行,瞧!

In case this doesn't work, don't be sad, there is another solution to deeply clean project

如果这不起作用,请不要难过,还有另一种深度清洁项目的解决方案

  1. Delete ios/and android/folders.

  2. Run react-native eject

  3. Run react-native link

  4. react-native run-ios

  1. 删除ios/android/文件夹。

  2. react-native eject

  3. react-native link

  4. 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

  1. run cd ios
  2. run pod install
  3. cd ..
  4. delete buildfolder
  5. run react-native run-ios
  1. cd ios
  2. pod install
  3. 光盘..
  4. 删除构建文件夹
  5. react-native run-ios

if error persists, 1. delete build folder again 2. open the /iosfolder 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-nativeby 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 buildfolder in iosfolder of your react native project

删除反应本机项目build文件夹中的ios文件夹

run:

跑:

react-native run-ios

if error persists:

如果错误仍然存​​在:

  • delete buildfolder again
  • open the /iosfolder 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 后,您可能有过时的依赖项。下面的步骤应该修复它。

  1. cd ios
  2. delete Podfile.lock
  3. pod deintegrate && pod install
  4. Navigate back to package.json directory
  5. run react-native run-ios
  6. In Xcode you can build your project again too
  1. cd ios
  2. 删除 Podfile.lock
  3. pod deintegrate && pod install
  4. 导航回 package.json 目录
  5. react-native run-ios
  6. 在 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-iconscommand.

对我来说,它是由安装 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

  1. react-native unlink react-native-vector-icons
  2. cd ios
  3. pod install
  4. cd ..
  5. react-native run-ios
  1. react-native unlink react-native-vector-icons
  2. cd ios
  3. pod install
  4. cd ..
  5. react-native run-ios

As I already installed an other icon library.

因为我已经安装了其他图标库。

回答by Angel

Here is the a possible solution

这是一个可能的解决方案

The problem is found in RealmReact.xcodeproj

问题在 RealmReact.xcodeproj 中找到