我已经构建了一个 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
因为没有一个解决方案像上面提到的那样有效