xcode React-native - 由于双重转换,构建失败

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/45252182/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:08:51  来源:igfitidea点击:

React-native - Build failed due to double-conversion

iosxcodereact-nativereact-native-androidreact-native-ios

提问by Balasubramanian

I have created new react-native project through terminal.

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

react-native init PlayWithAnimation  

when I run the react-native app through Xcode. I got this error.

当我通过 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)

/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:没有那个文件或目录

/Users/sumit/Desktop/React >Native/RNN/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh:第3行:/Users/sumit/Desktop /React Native/RNN/node_modules/react-native/React/scripts/ios-install-third-party.sh:没有那个文件或目录

/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/桌面/React Native/RNN/node_modules/react-native/React/scripts/ios-install-third-party.sh:无法执行:没有那个文件或目录

以下构建命令失败:

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

(1 次失败)

These are the version which I have used:

这些是我使用过的版本:

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

I have checked related to other stackoverflow Q & A but did't get proper solution.

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

Temporary Solution:

临时解决方案:

It works smoothly if I create react-native with version="0.44.0". But in version 0.45.0, 0.46.0, 0.47.0builds are failed and same "double-conversion"issue is getting. And one more thing, when I create new project third-party directory is missing.

如果我使用version="0.44.0". 但是在version 0.45.0, 0.46.0, 0.47.0构建中失败了,并且出现了相同的“双重转换”问题。还有一件事,当我创建新项目时,第三方目录丢失了。

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

What would be the problem ?

会有什么问题?

Tried Solution 1:

尝试解决方案1:

I did the following steps:

我做了以下步骤:

  1. download the files needed inside the .sh, put it in the ~/.rncache/.

  2. copy the downloaded files into node_modules/react-native/third-party/, ran tar -zxf *** to each file.

  3. build again. But not worked.

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

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

  3. 再建。但没有工作。

Tried Solution 2:

尝试解决方案2:

Handling third party build error on react-native 0.46x.and tried with githubissue.

处理 react-native 0.46x 上的第三方构建错误。并尝试解决github问题。

I was really excited to finally get started with React Native but this bug absolutely kills my ability to proceed. I'd really appreciate if someone could help me out with this.

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

采纳答案by Balasubramanian

Got the solution from jerry han here: The life saver

在这里从 jerry han 那里得到了解决方案The life saver

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

嗨 Bala,正如您所看到的错误日志,该错误来自‘WhiteSpace'您的工作路径。

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'.

That will be helpful for you.

这对你会有帮助。

With developing or operation work, you may be better not to use ‘space' on the path.

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

回答by ken

For me, what worked was just updating the Code Signing preference in Xcode to something different and back again.

对我来说,有效的只是将 Xcode 中的代码签名首选项更新为不同的内容,然后再返回。

E.g. I have Automatically manage signingoriginally turned on. Turning that off and back on again seems to resolve this issue.

例如,我Automatically manage signing最初是打开的。将其关闭并重新打开似乎可以解决此问题。