Search code examples
iosxcodereact-nativexcode14

Use of bitwise '|' with boolean operands | Xcode 14.3 fails builds using react-native Yoga


Just updated my Xcode to Version 14.3 today and the build is failing with the following error in the Yoga file:

Use of bitwise '|' with boolean operands

Looks like we have some issues with the iOS Yoga package. I don't want to rollback to lower version again. If someone can help to get over it, that would be nice.

I tried removing cached data and derived data and cleaning the build. Tried removing pods and node_modules as well. But nothing has helped.


Solution

  • I resolved it by putting 2 vertical bars "||" instead of one "|" in the code where it is failing.

    Then cleared the build and it is working fine now on Xcode 14.3. I Hope this helps someone.

    Edit:

    Above one is temporary solution. By using following solution we do not need to make change on every npm installation. It is suggested by @Carl G. @Mykola Odnosumov 's Solution in this thread is also helpful, it is similar solution. Thank you @Carl G and @Mykola Odnosumov

    https://github.com/facebook/react-native/issues/36758#issuecomment-1496210081

    1. install patch-package https://github.com/ds300/patch-package
    2. Modify the source code like this commit 52d8a79
    3. run npx patch-package react-native
    4. commit your changes. Done.