Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native run-ios build fail after xcode update to 8.0.

Okay so I've been working on this React Native project for a few weeks now without any issue. I recently updated to xCode 8.0 and RN build is failing. When I do "react-native run-ios", it returns a "BUILD FAILED" error. I tried it through xCode and it returns something similar. I tried looking around but I can't seem to find a solution to this. I'm sure it's probably some setting that changed within xcode that's messing it all up.

Running through terminal

>     ** BUILD FAILED **
> 
> 
> The following build commands failed:  CompileC
> /Users/macuser/Documents/FreeLance/theHaps/DaHAPS/ReactApp/ios/build/Build/Intermediates/RCTWebSocket.build/Debug-iphonesimulator/RCTWebSocket.build/Objects-normal/x86_64/RCTSRWebSocket.o
> RCTSRWebSocket.m normal x86_64 objective-c
> com.apple.compilers.llvm.clang.1_0.compiler (1 failure)
> /Users/macuser/Documents/FreeLance/theHaps/DaHAPS/ReactApp/node_modules/promise/lib/done.js:10
>       throw err;
>       ^
> 
> Error: xcodebuild process exited with code 65
>     at ChildProcess.<anonymous> (runIOS.js:102:14)
>     at emitTwo (events.js:100:13)
>     at ChildProcess.emit (events.js:185:7)
>     at maybeClose (internal/child_process.js:850:16)
>     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)

Running through xcode:

Xcode Error Screenshot

Thank you!

like image 893
Jophy Johnson Avatar asked Sep 18 '16 17:09

Jophy Johnson


3 Answers

Step 1:

  • go into your RN project folder and open ios > .xcodeproj
  • this will open the project in xcode.

Step 2:

  • Run the file and once the build fails, it'll show errors on the left side. Double click "RCTWebSocket" and it'll open up a new window/tab with more settings.

Picture of settings

Step 3:

  • find "Apple LLVM 8.0 - Custom Compiler Flags"
  • under it you'll see "other warning flags" - there should be two flags in there right now. click and delete both the flags.

Clean & Rerun your project and it should work like normal.

like image 93
Jophy Johnson Avatar answered Nov 16 '22 00:11

Jophy Johnson


You need to remove the custom compiler flags of -Werror and -Wall and clean (SHIFT + CMD + K)

like image 22
Computer's Guy Avatar answered Nov 15 '22 23:11

Computer's Guy


Answer from the OP of this question:

Now i have a solution to fix this
Select RCTWebSocket target in XCode and remove flag in build setting > custom compiler flag then build and run again!

Note: This answer is posted as an edit of the question described above. I just edited the question and created an answer on behalf of the OP and made it community wiki so that no credit goes to me. But now, that question is merged with this question and the answer moved here. I do not know anything about the context of these two questions. I just got that in review queue.

like image 28
3 revs Avatar answered Nov 16 '22 00:11

3 revs