I've got a CocoaPods React Native project in Xcode that has been working 99% of the time for the past few months. (the 1% is random stuff like this, linker errors, etc... that comes and goes seemingly at random).
I installed a new Pod and its corresponding npm dependency today, and in the past when I added pods I sometimes have issues until I try things like pod deintegrate, pod install, react-native link and clean the Xcode project, for example. But this time it seems nothing is fixing it.
Every time I build, whether for simulator or physical device, I get the following error from stdint.h
This file should only be included when compiling with MSVC.
It's pretty easy too find the source of the error, it's explicitly user-defined in stdint.h:
But I can't for the life of me figure out why it's getting triggered. It says right there in the comments that MSVC is included. To my knowledge, the C-based Xcode compiler should provide the MSVC version to satisfy the conditional. Additionally, throughout the course of my troubleshooting/experimenting the past few hours, the culprit calling the error has changed multiple times. Right now it's coming from RCTFBSDK but earlier it came from RNFirebase.
Checking the full error tree, I can find the files requesting `stdint.h, but given that its such a fundamental file I doubt it's relevant- but here:
Based on my investigation so far, I'm inclined to believe it is a configuration error in Xcode causing the problem, specifically something to do with CocoaPods (but frankly I'm not sure)
All I know is that it works without the Pod/npm dependency (which, by the way, is completely unrelated to Facebook SDK currently throwing the error) and when I add it to package.json and Podfile, do the standard npm install pod install react-native link this happens.
Here is what I've tried:
- Every single combination of
npm installnpm updatenpm linkreact-native linkpod deintegratepod install - Deleted xcworkspace and regenerated it with
pod install - Removed user-defined error conditional (build was successful but crashed shortly after launch with this error:
[fatal][tid:com.facebook.react.ShadowQueue] Exception '*** -[__NSArrayM insertObject:atIndex:]: index 1 beyond bounds for empty array' was thrown while invoking manageChildren on target UIManager with params (... - Completely reinstalled Xcode
- Reverted to previous git commit (from before I added the new pod) and it worked fine
- Shook my fist at it and yelled (last resort)
Also, I have 100% confidence in my Podfile and package.json integrity. I copied the installation procedure from a well established repository.
I was very surprised to find absolutely zero information regarding this. The closest thing I found relates to C++ (understandably).
Anyone got any theories on this? Thanks. Please let me know any other specific info I did not provide.

