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

2024-05-18

我已经构建了一个 React Native 的 Android 项目,它运行良好。然后我开始了 iOS 部分。我正在使用react-native-cli:2.0.1react-native:0.60.4和Xcode 10和Mac OS Mojave

默认 pod 文件在安装 glog 时出现一些问题 它给出了错误/bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory when pod install被处决。即使在完成了 GitHub 和 stack Overflow 上回答的所有事情之后,例如安装 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-没有这样的文件或目录/10054 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。

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

现在坚持这个

/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 deintegrate 和 pod install 。对于 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因为没有一个解决方案像上面提到的那样有效


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

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

$ file ./configure

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

编辑: 在./configure : /bin/sh^M : 错误的解释器 https://stackoverflow.com/questions/2920416/configure-bin-shm-bad-interpreter您还有其他重新转换选项。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

React Native glog iOS:未知类型名称“_START_GOOGLE_NAMESPACE_” 的相关文章

随机推荐