首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >React本机iOS构建失败

React本机iOS构建失败
EN

Stack Overflow用户
提问于 2018-06-06 18:06:05
回答 2查看 1.1K关注 0票数 0

由于某些原因,当我尝试构建和运行我的应用程序时,我收到了很多错误

代码语言:javascript
复制
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如下所示:

代码语言:javascript
复制
<?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>
EN

回答 2

Stack Overflow用户

发布于 2018-06-06 18:35:45

你可以像下面这样尝试

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

代码语言:javascript
复制
> 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
票数 0
EN

Stack Overflow用户

发布于 2018-06-06 18:42:40

你能在ios/你的项目名/ Info.plist中检查你的Info.plist,看看你是否有CFBundlerIdentifier吗?

如果剥离一切正常,你还可以运行

代码语言:javascript
复制
sudo lsof -i :8081

如果找到结果,例如:

代码语言:javascript
复制
node 7601 XXXX 23u IPv6 0xc6b249599e5f1169 0t0 TCP *:sunproxyadmin (LISTEN)

终止进程

代码语言:javascript
复制
kill -9 7601

然后重试:

代码语言:javascript
复制
react-native run-ios
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50717691

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档