【发布时间】:2019-12-15 03:41:09
【问题描述】:
我已经构建了一个运行良好的 react native 的 android 项目。然后我从 iOS 部分开始。我正在使用 react-native-cli: 2.0.1 react-native: 0.60.4 和 Xcode 10 和 Mac OS Mojave
默认的 pod 文件在安装 glog 时出现了一些问题,当执行 pod install 时,它给出了错误 /bin/bash: ./configure: /bin/sh^M: bad interpreter: No such file or directory。即使在 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。
在那之后,我通过在 ios/Pods/glog/src/config.h 文件中添加 define no_thread 更正了 glog Need to implement mutex.h for your architecture, or #define NO_THREADS 的另一个问题
现在坚持这个
/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 的情况下重新安装它,因为没有一个解决方案可以像上面提到的那样工作
【问题讨论】:
-
你找到答案了吗?
-
你在环境地狱的中间。不幸的是,我之前已经修复了这个错误,但是因为它需要我沿着 1000 条道路行驶才能找到正确的修复,所以我不记得我做了什么来修复它。我只能说,除了祝你好运,继续努力——甚至重做你已经做过的事情。我认为修复可能涉及您找到的所有来源的部分 - 虽然我从来不需要修改 glog 来安装它,但我确实必须多次尝试安装才能让它工作。
-
我发现有时会有所帮助的一件事是不要使用 Cocoapods,而是从已安装的 node_modules 文件夹中手动安装依赖项。如果你能在 cocoapods 中去除足够多的 deps,你也许可以从你的 cocoapods 中去除反应——我发现把它放在里面几乎会搞砸一切。如果您需要帮助,请按照此操作。 facebook.github.io/react-native/docs/linking-libraries-ios
标签: xcode react-native cocoapods fbsdk glog