React native glog iOS:未知类型名称“ _START_GOOGLE_NAMESPACE_”

Nil*_*rne 6 xcode glog cocoapods react-native fbsdk

我已经建立了一个反应本机的android项目,它工作正常。然后,我从iOS部分开始。我正在使用react-native-cli:2.0.1 react-native:0.60.4和Xcode 10和Mac OS Mojave

默认的pod文件在安装glog /bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory时遇到一些问题pod install。执行时出现错误。即使在GitHub上做了所有回答后,堆栈溢出(例如安装Cocoapods,重新安装,ruby安装,链接cocoapods)也是如此。然后稍后在GitHub上,我发现pod文件存在一些问题,因此将其替换为在GitHub上为react-native指定的正确内容。然后根据此链接仍然无法工作: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,然后我修改了glog文件,然后它成功安装了glog。

之后,Need to implement mutex.h for your architecture, or #define NO_THREADS我通过define no_thread在ios / Pods / glog / src / config.h文件中添加来更正了glog的另一个问题

现在卡住了

/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

我认为我的glog安装无法顺利进行。我已经在使用项目工作区。

我检查了整个GitHub Facebook react-native和堆栈溢出,但没有发现任何东西。我尝试过旧版构建,清除派生数据。我还尝试了Pod解集成和Pod安装。对于glog我也尝试过cd ./node_modules/react-native/third-party/glog-0.3.4 && ../../scripts/ios-configure-glog.sh

我该如何解决这个问题?有什么办法可以完全删除glog并重新安装它,而又/bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory没有解决该问题的方法,如上所述

Ram*_*mus 0

该./configure文件可能已在 DOS 或 Windows 环境中编辑过。(notepad例如,使用 )。该版本可能在每行末尾添加了回车符(^M 或 \r)...在 Unix 环境中不兼容。

您可以通过以下方式检查:

$ file ./configure
Run Code Online (Sandbox Code Playgroud)

要将其重新转换为 unix 格式,您可以使用dos2unix或编辑vi -b(二进制模式下的 vi)。

编辑:在./configure : /bin/sh^M :错误的解释器中,您还有其他重新转换选项。