iosxcodereact-nativegradlefolly

RCT-Folly/folly/Optional.h:474:36 Invalid operands to binary expression ('const bool' and 'const std::nullopt_t')


The error from the title points at following lines

template <class U, class V>
constexpr bool operator==(const Optional<U>& a, const V& b) {
  return a.hasValue() && a.value() == b;
}

I am trying to update a react native app from 0.64.2 to 0.73.6 and I managed to run android, but I am getting this error in iOS. There is pretty much no info about this error on google and I am stuck here. I am trying to run the app on Xcode 15 with node 21, jdk 20, gradle 8.3 and kotlin 1.8

When I try to run the app from VSCode terminal using npm run ios, this is what I get

The following build commands failed:
        CompileC /Users/purplekey/Library/Developer/Xcode/DerivedData/Takeda-fmiosazmvbloaggqakcseuazkcsb/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-Fabric.build/Objects-normal/arm64/PropsParserContext.o /Users/purplekey/Desktop/Projects/Takeda_MedInfo_Mobile_v3/node_modules/react-native/ReactCommon/react/renderer/core/PropsParserContext.cpp normal arm64 c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'React-Fabric' from project 'Pods')
(1 failure)

My react native development environment is all set because I am working with react native for quite some time, but I never had an oportunity to update rn version.

If you need more info about this problem I can provide it.


Solution

  • Perform the following steps

    1. Delete derived folder from xcode by going to xcode settings --> location
    2. Delete Pods folder and Podfile.lock from ios folder
    3. pod deintegrate
    4. Update cocoapods version using homebrew
    5. pod install