1

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
Cœur
  • 37,241
  • 25
  • 195
  • 267
Adrian Zghibarta
  • 397
  • 2
  • 5
  • 17

8 Answers8

2

I had this same issue and it was fixed by deleting the contents of node_modules and doing a npm install in the parent folder.

2

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.

zuluk
  • 1,557
  • 8
  • 29
  • 49
Emre Yasar
  • 41
  • 3
0

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.

user550088
  • 712
  • 1
  • 8
  • 16
  • I've updated React Native version and this issue is no more present, but my project name was short (5 characters only), maybe the problem is in the path of the project? – Adrian Zghibarta Oct 02 '17 at 08:59
0

I had a issue with XCode 9.1 and iOS 11... enter image description here 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

DariusV
  • 2,645
  • 16
  • 21
0

What helped me was removing the ios/build folder in my React Native project, followed by rebuilding the project.

g00glen00b
  • 41,995
  • 13
  • 95
  • 133
Mark Vayngrib
  • 974
  • 5
  • 14
0

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.

jsdario
  • 6,477
  • 7
  • 41
  • 75
0

Trashing ios/Build resolved this issue for me

drkoss
  • 79
  • 1
  • 6
0

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

Dinesh Chitta
  • 670
  • 8
  • 23