I have recently upgraded my macOS version to macOS Sequoia 15.0, and as per consequence I have upgraded my Xcode version to 16.0.
When I build my react native app on my terminal it shows error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app
When I try to build it in Xcode, it fails with a crash
Xcode throws a Logic Error – Division by Zero
How can I fix this? I cannot run my react native app at all
2
Answers
Xcode 16 has made some changes related to bitcode. May be you need to do:
pod update
orpod install
again to generate new standards according to Xcode 16.Okay, I think I see what’s going on. If this is React’s code, they need to change it.
The idea here, apparently, is to deliberately divide by zero and thus cause a runtime error. But unfortunately for that plan, the Swift compiler catches the division by zero, and stops the code from even compiling. The code contains a "trick" that tries to hide the division by zero from the compiler; but the compiler is now too smart, and catches it anyway.
The React people can revise the code as follows to work around the problem:
That hides the division from the compiler, but crashes when called at runtime.