React Native iOS构建失败

时间:2018-06-06 10:06:05

标签: react-native build

出于某种原因,当我尝试构建并运行我的应用程序时,我遇到了很多错误

CompileC /Users/EcoSurvUser/Desktop/eco-surv/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/vlog_is_on.o /Users/EcoSurvUser/Desktop/eco-surv/node_modules/react-native/third-party/glog-0.3.4/src/vlog_is_on.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
    CompileC /Users/EcoSurvUser/Desktop/eco-surv/ios/build/Build/Intermediates.noindex/React.build/Debug-iphonesimulator/third-party.build/Objects-normal/x86_64/utilities.o /Users/EcoSurvUser/Desktop/eco-surv/node_modules/react-native/third-party/glog-0.3.4/src/utilities.cc normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)

Installing build/Build/Products/Debug-iphonesimulator/ecosurv.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=22):
Failed to install the requested application
The bundle identifier of the application could not be determined.
Ensure that the application's Info.plist contains a value for CFBundleIdentifier.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

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

有趣的部分是它在我的朋友计算机上工作

更新:

我的ios / build / dinfo.plist看起来像:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>LastAccessedDate</key>
    <date>2018-06-06T10:17:34Z</date>
    <key>WorkspacePath</key>
    <string>/Users/EcoSurvUser/Desktop/eco- 
    surv/ios/ecosurv.xcodeproj</string>
</dict>
</plist>

2 个答案:

答案 0 :(得分:0)

您可以尝试以下

您需要删除ios,android和node module文件夹。运行以下命令

> npm install //to get the node module folder

> react-native upgrade //to get android and ios folder

> react-native link // for linking the libraries

> react-native run ios/android

答案 1 :(得分:0)

您能否在ios / yourProjectName / info.plist中查看Info.plist,看看您是否有CFBundlerIdentifier?

如果一切正常,那么你也可以运行

sudo lsof -i :8081

如果找到结果,例如:

node 7601 XXXX 23u IPv6 0xc6b249599e5f1169 0t0 TCP *:sunproxyadmin (LISTEN)

杀死进程

kill -9 7601

再试一次:

react-native run-ios