skip to Main Content

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

enter image description here

enter image description here

2

Answers


  1. Xcode 16 has made some changes related to bitcode. May be you need to do:

    pod update or pod install again to generate new standards according to Xcode 16.

    Login or Signup to reply.
  2. 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:

    @objc public func invokeNC(_ x: Int = 1) {
        var zero = 1
        zero = zero - x
        _ = 1/zero
    }
    

    That hides the division from the compiler, but crashes when called at runtime.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search