ReactNative踩坑系列--构建失败

Posted 庚午月圆人

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ReactNative踩坑系列--构建失败相关的知识,希望对你有一定的参考价值。

初始化项目后执行react-native run-ios,构建失败:

** BUILD FAILED **


The following commands produced analyzer issues:

    Analyze /Users/lcz/workspace/APP/temp/node_modules/react-native/ReactCommon/yoga/yoga/YGNodeList.c
    Analyze /Users/lcz/workspace/APP/temp/node_modules/react-native/ReactCommon/yoga/yoga/Yoga.c
(2 commands with analyzer issues)

The following build commands failed:
    PhaseScriptExecution Install\ Third\ Party /Users/lcz/workspace/APP/temp/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/temp.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/temp.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

上网查了很多资料没有找到解决方案,估计是react-native版本的问题。

测试版本:

"react": "16.0.0-alpha.12",
"react-native": "0.45.0"

切换成下面的版本就可以了:

"react": "16.0.0-alpha.6",
"react-native": "0.44.3"

具体操作:删除node-modules文件夹,修改pakage.json文件,然后执行npm install

 

注意:react版本要和react-native版本搭配,上面版本只换一个也会出错

 

以上是关于ReactNative踩坑系列--构建失败的主要内容,如果未能解决你的问题,请参考以下文章

React Native:在执行“yarn ios”后构建失败

React Native 构建命令失败:PhaseScriptExecution ...(域=NSPOSIXErrorDomain,代码=2)

React Native,AwesomeProject,react-native run-ios:** 构建失败 **

GraphQL + Relay 现代片段给了我一系列空帖子

Android Studio 和 Gradle:“构建失败,出现异常。”

Facebook SDK 导致 React Native 构建失败