Satheesh
Satheesh

Reputation: 11276

React native iOS build issue - glog - Use of undeclared identifier 'SYS_gettid'

My project was working fine until I forked a version of react-native and tried to setup the RNTester app on my local machine. I removed node_modules & tried to do a fresh install but nothing works. It fails always at

pid_t tid = syscall(__NR_gettid); -- Use of undeclared identifier 'SYS_gettid'

In the file /Pods/glog/utilities.cc.

I am breaking my head, any help is appreciated.

Things I tried so far,

https://github.com/openstreetmap/mod_tile/issues/114

Mojave + Xcode 10 build fails on glog config.h, gflags/gflags.h

Upvotes: 4

Views: 7622

Answers (1)

Michał Pierzchała
Michał Pierzchała

Reputation: 1850

Long story short: remove Pods and hard remove Xcode cache.

Run rm -rf ios/Pods, then press Cmd + Option/Alt + Shift + K to hard clean Xcode project (with DerivedData). Then running pod install again should fix it.

Longer story:

SYS_gettid is not available on macOS, so React Native builds glog with an "arm-apple-darwin" host through ios-configure-glog.sh file that runs during pod install step: https://github.com/facebook/react-native/blob/0.61-stable/scripts/ios-configure-glog.sh#L31. I'd say it's a CocoaPods issue that the script didn't kick in, but it's hard for me to verify it.

Upvotes: 4

Related Questions