由于某些原因,当我尝试构建和运行我的应用程序时,我收到了很多错误
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>发布于 2018-06-06 18:35:45
你可以像下面这样尝试
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发布于 2018-06-06 18:42:40
你能在ios/你的项目名/ 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-ioshttps://stackoverflow.com/questions/50717691
复制相似问题