简体   繁体   中英

Build operation failed without specifying any errors for React Native Xcode project

I have a React Native project that works fine most of the time(Android and iOS). But sometimes out of nowhere I receive this error when I am trying to build the Xcode project (Xcode or react-native run-ios ):

Build operation failed without specifying any errors. 
Individual build tasks may have failed for unknown reasons.
One possible cause is if there are too many (possibly zombie)
processes; in this case, rebooting may fix the problem.
Some individual build task failures (up to 12) may be listed below.

How do I solve this? Push to a branch on git, fresh clone, npm install, and all is working fine for a period. And after that the problem will repeat. Making fresh clones of project each time is a pain and takes long time. Is there another way or something that I don't know?

Maybe a some files that are in .gitignore is causing the problems, and after a fresh clone that solves the problem. This is the .gitignore file for my iOS project:

# Created by .ignore support plugin (hsz.mobi)
# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

我遇到了同样的问题,并通过删除node_modules的内容并在父文件夹中进行npm安装来解决此问题。

I was faced with this problem too. And I noticed that my folder name was too long. I changed the project folder's name with the short one and this error gone. Try to change the project folder name.

It was really a time killer issue. I rebased the complete code base to a collegue's mac where it worked fine. After sparing more than a couple of morning hours I could find a solution.

Solution - Simply shorten your Project folder name (in mac). This is undoubtedly irritating that its suggested to have longer and meaningful variable names but the folder name has to be this concise.

I had a issue with XCode 9.1 and iOS 11... 在此处输入图片说明 I solved this issue moving up my folder to another path, I know it doesn't make sense and is dumb but it really work for me. My project was at /Users/Me/Documents/MyProjectDir and I changed to /Users/Me/Desktop/MyProjectDir

帮助我的是删除React Native项目中的ios/build文件夹,然后重建该项目。

I highly recommend to run the build on console , to see if it outputs any other relevant information.

react-native run-ios --scheme "app-debug" # Or any aproppriate target

Read more about building+archiving from CLI here or try with other OSS tooling like fastlane .

For me it found bugs twice, that both were unrelated with the building process itself:

1) One was fixed rolling back to node v8 (LTS) apparently. It was very obscure, but I suspect had to do with having little memory available (running flow + packager + xcode + spotify + chrome on 8GB RAM MBP)

2) The other one was related to having a space on the xcode output. "App Canary.app" could not be installed. I figured it out doing ls ios/build/Build/products... . This error only happened after upgrading xcode, and wasn't happening with the release target, that did not have any whitespaces.

The only take away here is to run build directly on the console to debug further . You might find out things that are completely unrelated, and probably can't be solved by just removing the build folder.

Hope it helps.

垃圾iOS / Build为我解决了这个问题

In my case simulator is not shutdown correctly.

So I opened simulator manually again then I got an error that simulator is not shutdown correctly.So I relaunched the simulator successfully and built xcode project again. Error is resolved

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM