React native glog iOS : Unknown type name '_START_GOOGLE_NAMESPACE_'

glog react-native
pod install glog error
react-native pod install error
pod install glog configure error c compiler cannot create executables
installing flipper glog (0.3 6)
flipper-glog/0.3 6 1dfd6': configure: error: c compiler cannot create executables
pod install failing

I already built an android project of react native which is working fine. I then started with iOS part. I am using react-native-cli: 2.0.1 react-native: 0.60.4 and Xcode 10 and Mac OS Mojave

The default pod file had some issues installing glog It gave error /bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory when pod install was executed. Even after doing everything answered on GitHub and stack overflow like installing Cocoapods, reinstalling, ruby installation, linking cocoapods. Then later on GitHub I found out that pod file had some issues so replaced it with correct content specified on GitHub for react-native. Still did not work then according to this link : https://forums.expo.io/t/pod-install-errors-on-newly-detached-app-on-macos-installing-glog-bin-bash-configure-bin-sh-m-bad-interpreter-no-such-file-or-directory/10054 and then I modified the glog file and then it installed the glog successfully.

After that another issue with glog Need to implement mutex.h for your architecture, or #define NO_THREADS which I corrected by adding define no_thread in ios/Pods/glog/src/config.h file

And now stuck with this

/Volumes/Projects/derive-mobile/ios/Pods/glog/src/utilities.h:148:1: Unknown type name '_START_GOOGLE_NAMESPACE_' /Volumes/Projects/derive-mobile/ios/Pods/glog/src/utilities.h:168:1: Unknown type name 'int64'; did you mean 'google::int64'? /Volumes/Projects/derive-mobile/ios/Pods/glog/src/utilities.h:170:20: Unknown type name 'int64'; did you mean 'google::int64'? /Volumes/Projects/derive-mobile/ios/Pods/glog/src/utilities.h:175:1: Unknown type name 'int32'; did you mean 'google::int32'? /Volumes/Projects/derive-mobile/ios/Pods/glog/src/utilities.h:236:1: Unknown type name '_END_GOOGLE_NAMESPACE_' /Volumes/Projects/derive-mobile/ios/Pods/glog/src/utilities.h:150:1: Expected unqualified-id

I think my glog installation did not go well. I am using project workspace already.

I have checked overall GitHub Facebook react-native and stack overflow but did not found anything. I have tried legacy build, clearing derived data. I have also tried pod deintegrate and pod install. for glog I have also tried cd ./node_modules/react-native/third-party/glog-0.3.4 && ../../scripts/ios-configure-glog.sh

How can I solve this issue ? is there any way to remove the glog completely and install it again without having the /bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory as none of the solutions works as mentioned above

The ./configure file may have been edited in a DOS or Windows environment. (With a notepad, for example). That edition may have added a carriage return (^M or \r) at the end of each line... incompatible in a unix environment.

You can check it by:

$ file ./configure

To re-convert it to unix format you can use dos2unix or edit with vi -b (vi in binary mode).

edit: In ./configure : /bin/sh^M : bad interpreter you have other re-conversion options.

[0.60.4] iOS Build is failing on empty project due to glog compilation , /ios/Pods/glog/src/base/mutex.h:188:3: error: unknown type name 'MutexType' React native init with 0.60.4 fails to build in xcode #25870. Is this a bug report? Yes Have you read the Contributing Guidelines? Yes Environment react-native -v: react-native-cli: 2.0.1 react-native: 0.48.3 node -v: v8.4.0 npm -v: 5.3.0 yarn --version: 1.0.1 Then, specify: Target Platform: iOS 11

I still haven't determined a long term solution to this problem, but I've gotten a little farther than this thread.

Right now, every time after I call a yarn command, I need to update ios-configure-glog.sh to replace these lines:

./configure --host arm-apple-darwin

# Fix build for tvOS
cat << EOF >> src/config.h

/* Add in so we have Apple Target Conditionals */
#ifdef __APPLE__
#include <TargetConditionals.h>
#include <Availability.h>
#endif

/* Special configuration for AppleTVOS */
#if TARGET_OS_TV
#undef HAVE_SYSCALL_H
#undef HAVE_SYS_SYSCALL_H
#undef OS_MACOSX
#endif

/* Special configuration for ucontext */
#undef HAVE_UCONTEXT_H
#undef PC_FROM_UCONTEXT
#if defined(__x86_64__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__rip
#elif defined(__i386__)
#define PC_FROM_UCONTEXT uc_mcontext->__ss.__eip
#endif
EOF

with these lines

dos2unix -f configure
dos2unix -f config.sub
dos2unix -f config.guess
./configure --host arm-apple-darwin
cp {THE FULL PATH TO MY PROJECT}/node_modules/react-native/ReactAndroid/src/main/jni/third-party/glog/config.h src

This fixes all of my glog issues with one fix, but it's not permanent and I don't really want to fork react-native to make it permanent.

Maybe this will point someone else in the right direction to come up with the long term fix. I've narrowed the bad file formatting to those 3 files (configure, config.sub, config.guess) which all seem to reside inside of my Xcode application but appear to use LF line endings so I don't really know how the error is happening.

I might also be removing too much from this file, but I haven't seen any problems related to that.

Building React Native from source failing on Android � Issue #24351 , Building React Native from source failing on Android #24351 -ndk/glog/ exported/glog/logging.h:661:1: error: unknown type name 'LogSeverity' 4.7.0 - / usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.1, macOS� Build configuration on iOS Using React Native Link (React Native 0.59 and lower) Run react-native link react-native-maps after which you should be able to use this library on iOS. Note that by default this will use Apple Maps and you will miss some of the features provided by Google (see the instruction on manually enabling Google Maps below).

I tried dos2unix but honestly, I don't know which file should I apply it to. Because if you do pod install --verbose, you see that glog is being downloaded to a random temporary folder, and built (that's where it fails). So I don't have control.

So, I tried something else. Created a new user in my Mac. Xcode being a shared application. And pod install just worked. No complains. Now, see, the difference in the console outputs seems to point to trunk.

This one is from the new user. It works.

There you can see "Adding spec repo trunk"...

Now see my non working command log (from my original user).

There's nothing about trunk. And it starts checking the cache, and downloading packages (like glog and Folly). Don't know why. Installing dependencies from the new user was just a breeze.

Hope this hint may lead to a different solution. It may be something about a user setting/configuration. Like UTF-8 or something.

React native glog iOS : Unknown type name, I already built an android project of react native which is working fine. I then started with iOS part. I am using react-native-cli: 2.0.1 react-native:� 5- delete ios/podfile.lock 6- remove react-native-maps frome package.json and any line belongs to it in the ios/Podfile 7- npm install && cd ios && pod install 8- follow react-native-google-signin install instructions 9- ensure every thing works fine 10- start install react-native-maps. Hope this helps

xcode - React native glog iOS:未知类型名称'_ , React native glog iOS : Unknown type name '_START_GOOGLE_NAMESPACE_' . 发表于 2019-08-07 13:19:09. 活跃于 2019-08-16 21:44:24. 查看105 次. Pod installation is a part of initial project generation phase. If you run react-native init AwesomeProject it installs pods after generating initial structure.. @slavikdenis I see that you tagged a lot of issues, but looks like the errors are completely different, non of them are related to glog as described in this issue.

React native glog iOS:未知类型名称, React native glog iOS:未知类型名称'_START_GOOGLE_NAMESPACE _'. 时间:2019-08-07 Unknown type name '_START_GOOGLE_NAMESPACE_'� Podfile # Uncomment the next line to define a global platform for your project platform :ios, '9.0' target 'SportJoe' do # Uncomment the next line if you're using Swift or would like to use dynamic frameworks # use_frameworks!

xcode - React native glog iOS:未知类型名称, 我正在使用react-native-cli:2.0.1 react-native:0.60.4和Xcode 10和Mac OS Mojave 默认Pod文件 Unknown type name '_START_GOOGLE_NAMESPACE_ ' Many different kinds of people use React Native: from advanced iOS developers to React beginners, to people getting started programming for the first time in their career. These docs were written for all learners, no matter their experience level or background.

Comments
  • Have you found the answer?
  • You are in the middle of environment hell. Unfortunately, I have fixed this error before, but since it required me to travel down 1000 roads to find the correct fix, I can't remember what I did to fix it. All I can say, beside good luck, is to keep trying - even redoing things you've already done. I think likely the fix involves parts from all the sources you've found - although I never had to modify glog to get it to install, but I did have to try the install many times to get it to work.
  • One thing I found that sometimes helps, is to not use Cocoapods, and install the dependencies manually from your installed node_modules folder. If you can get rid of enough deps in cocoapods, you may be able to remove react from your cocoapods - I found having it in there screws up pretty much everything. Follow this if you need help with that. facebook.github.io/react-native/docs/linking-libraries-ios
  • Thank you for your reply. I already tried that, In the link provided in the question but did not work.