ios - React-native - 由于双重转换导致构建失败

标签 ios xcode react-native react-native-ios

我已经通过终端创建了新的 react-native 项目。

react-native init PlayWithAnimation  

当我通过 Xcode 运行 react-native 应用程序时。我收到了这个错误。

enter image description here

/bin/sh -c \"/Users/sumit/Desktop/React\ Native/RNN/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh\"

/Users/sumit/Desktop/React >Native/RNN/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh: line 2: cd: /Users/sumit/Desktop/React: No such file or directory

/Users/sumit/Desktop/React >Native/RNN/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh: line 3: /Users/sumit/Desktop/React Native/RNN/node_modules/react-native/React/scripts/ios-install-third-party.sh: No such file or directory

/Users/sumit/Desktop/React Native/RNN/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh: line 3: exec: /Users/sumit/Desktop/React Native/RNN/node_modules/react-native/React/scripts/ios-install-third-party.sh: cannot execute: No such file or directory

The following build commands failed:

PhaseScriptExecution Install\ Third\ Party /Users/sumit/Desktop/React\ Native/RNN/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh

(1 failure)

这些是我用过的版本:

node v8.0.0
npm 5.0.3
react-native-cli: 2.0.1
react-native: 0.46.0
xcode 8.3.3

我已经检查了与其他 stackoverflow 问答相关的内容,但没有得到适当的解决方案。

临时解决方案:

如果我使用 version="0.44.0" 创建 react-native,它会顺利运行。但是在版本 0.45.0、0.46.0、0.47.0 中,构建失败并且出现了同样的“双重转换” 问题。还有一件事,当我创建新项目时,第三方目录丢失了。

node_modules/react-native/ (missing third-party directory)

会是什么问题?

尝试过的解决方案 1:

我做了以下步骤:

  1. 下载.sh里面需要的文件,放到~/.rcache/中。

  2. 将下载的文件复制到 node_modules/react-native/third-party/,对每个文件运行 tar -zxf ***。

  3. 再次构建。但没有奏效。

尝试过的解决方案 2:

Handling third party build error on react-native 0.46x. 并尝试使用 github问题。

我真的很高兴终于开始使用 React Native,但这个错误绝对扼杀了我继续前进的能力。如果有人能帮我解决这个问题,我将不胜感激。

最佳答案

Got the solution from jerry han here : 救命稻草

Hi Bala, As you can see the error log, That error was from ‘WhiteSpace’ on your working path.

Real Path : /Users/sumit/Desktop/React\ Native/
On cd cmd log : /Users/sumit/Desktop/React:
You should rename your working path to ‘/Users/sumit/Desktop/react_native’.

这对你有帮助。

对于开发或运维工作,您最好不要在路径上使用“空格”。

关于ios - React-native - 由于双重转换导致构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45252182/

相关文章:

android - 如何在 React Native 中使用 ListView 获得跑马灯效果?

javascript - React Native 高阶组件问题

objective-c - 对 NSTableView 的简单尝试,它没有显示任何内容

objective-c - opencv 构建问题 ("_cvLoadImage",引用自)

ios - 这是否覆盖了方法?

ios - 如何通过 CBL2CAPChannel 发送和接收数据

objective-c - 为什么在 XCode4 中创建新的 Objective-C 类文件不会创建 "An Objective-C class, with a header that includes the <Cocoa/Cocoa.h> header."

android - 在 React-Native 中发布不同版本的 Android 应用

ios - 将对象用作核心数据对象字段类型

ios - 进行本地化时使用自动布局取消自动 RTL 翻转