ios 打印:条目,“:CFBundleIdentifier”,不存在
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/37461703/
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
Print: Entry, ":CFBundleIdentifier", Does Not Exist
提问by astiefel
When I run react-native run-ios
the build succeeds but I get the error below. I've checked all over the place but nothing seems to be working. Using sudo
in front of the command does not help either. I am using Xcode 7.3, react-native-cli: 0.2.0, react-native: 0.24.1, node v5.11.0.
当我运行react-native run-ios
构建成功但我收到以下错误。我已经检查了所有地方,但似乎没有任何效果。sudo
在命令前面使用也无济于事。我正在使用 Xcode 7.3,react-native-cli:0.2.0,react-native:0.24.1,节点 v5.11.0。
=== BUILD TARGET mobileTests OF PROJECT mobile WITH CONFIGURATION Release ===
Check dependencies
** BUILD SUCCEEDED **
Installing build/Build/Products/Debug-iphonesimulator/mobile.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
/Users/astiefel/workspace/bosspayments/mobile/node_modules/promise/lib/done.js:10
throw err;
^
Error: Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/mobile.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist
at checkExecSyncError (child_process.js:470:13)
at Object.execFileSync (child_process.js:490:13)
at _runIOS (runIOS.js:91:34)
at runIOS.js:24:5
at tryCallTwo (/Users/astiefel/workspace/bosspayments/mobile/node_modules/promise/lib/core.js:45:5)
at doResolve (/Users/astiefel/workspace/bosspayments/mobile/node_modules/promise/lib/core.js:200:13)
at new Promise (/Users/astiefel/workspace/bosspayments/mobile/node_modules/promise/lib/core.js:66:3)
at Array.runIOS (runIOS.js:23:10)
at Object.run (/Users/astiefel/workspace/bosspayments/mobile/node_modules/react-native/local-cli/cli.js:86:13)
at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:88:7)
采纳答案by astiefel
My problem was actually that my build was in Release mode instead of Debug mode. As a result, the identifier was pointing to something that was not in existence. I changed the build type and it ended up working.
我的问题实际上是我的构建处于发布模式而不是调试模式。结果,标识符指向了不存在的东西。我更改了构建类型,结果正常工作。
回答by Katta Nagarjuna
Open Project in Xcode
在 Xcode 中打开项目
If Xcode > 9
run command react-native upgrade
(this overwrites all your iOS configurations, use with caution!)
如果 Xcode > 9 运行命令react-native upgrade
(这会覆盖您所有的 iOS 配置,请谨慎使用!)
then
然后
1.Go to File -> Project settings
1.转到文件->项目设置
2.Click the Advanced button
2.点击高级按钮
3.Select "Custom" and select "Relative to Workspace" in the pull down
3.选择“自定义”,在下拉菜单中选择“相对于工作区”
4.Change "Build/Products" to "build/Build/Products"
4.将“构建/产品”更改为“构建/构建/产品”
5.click done, done
5.点击完成,完成
回答by Lijith Vipin
This is may occurs if you are missing config.hfile,
如果您缺少config.h文件,则可能会发生这种情况,
For update config.hfile,
对于更新config.h文件,
1) Close your Xcode.
1) 关闭您的 Xcode。
2) Open Terminal, go to your project's root folder and do:
2)打开终端,转到项目的根文件夹并执行:
cd node_modules/react-native/third-party/glog-{X}.{X}.{X}/
3) Run the configure script:
3)运行配置脚本:
./configure
4) Open Xcode and try to run your app.
4) 打开 Xcode 并尝试运行您的应用程序。
{X}: version number glog
{X}:版本号 glog
回答by sbastidasr
Update React using react-native upgrade
did it for me.
使用更新 Reactreact-native upgrade
为我做了。
Disclaimer: this overwrites all your iOS configurations, use with caution!
免责声明:这会覆盖您所有的 iOS 配置,请谨慎使用!
回答by ChrisBorg
If you're using Xcode 10, it may be due to an incompatibility with the latest build system of Xcode. Try switching to the legacy build system.
如果您使用的是 Xcode 10,则可能是由于与最新的 Xcode 构建系统不兼容。尝试切换到旧版构建系统。
Open Xcode 10, File > Project Settings > Build System > switch dropdown to Legacy Build System.
打开 Xcode 10,文件 > 项目设置 > 构建系统 > 切换下拉菜单到旧构建系统。
回答by Usman Awan
I also came across this issue as well and I found a way to fix it
我也遇到了这个问题,我找到了解决它的方法
Here is what i did:
这是我所做的:
1) Make sure there is no white spaces in the file directory.
1) 确保文件目录中没有空格。
2) cd project directory
2)cd项目目录
3) run command react-native upgrade
3) 运行命令react-native upgrade
4) Go to native ios folder and open xcode project.
4) 转到本机 ios 文件夹并打开 xcode 项目。
5) Go to File > Project Settings > Advanced...
5)转到文件>项目设置>高级...
6) select custom > Relative to workspace
6)选择自定义>相对于工作区
7) products path should be 'build/Build/Products'
7)产品路径应该是'build/Build/Products'
8) intermediates path should be 'build/Build/Intermediates'
8) 中间体路径应该是'build/Build/Intermediates'
9) now try running command in your terminal react-native run-ios
9) 现在尝试在您的终端react-native run-ios 中运行命令
I hope that this solutions will help some of us facing this issue.
我希望这个解决方案能帮助我们中的一些人面对这个问题。
回答by Tim
For [email protected]
the following did the trick for me:
因为[email protected]
以下对我有用:
1) Check your paths, open your .xcodeproj (not .xcworkspace) file and:
1) 检查您的路径,打开您的 .xcodeproj(不是 .xcworkspace)文件并:
go to File > Project Settings > Advanced
custom > Relative to workspace
- set the products path to
'build/Build/Products'
- set the intermediates path to
'build/Build/Intermediates'
- press done and save your changes
转到文件 > 项目设置 > 高级
自定义 > 相对于工作区
- 将产品路径设置为
'build/Build/Products'
- 将中间路径设置为
'build/Build/Intermediates'
- 按完成并保存您的更改
2) Run rm -rf ios/build
in your project's root directory
2)rm -rf ios/build
在你的项目根目录下运行
3) Close your react packager
3)关闭你的反应包装器
4) Run react-native run-ios
again
4)react-native run-ios
再次运行
回答by Jade
I had this happen to me when my node_modules folder got screwy after installing a new package. I killed the folder rm -rf node_modules
and then did an npm install
to re-install my packages and that fixed it.
当我的 node_modules 文件夹在安装新软件包后变得棘手时,我就遇到了这种情况。我杀死了该文件夹rm -rf node_modules
,然后npm install
重新安装了我的软件包并修复了它。
回答by Héctor Ramos
The Print: Entry, ":CFBundleIdentifier", Does Not Exist
message just indicates your project failed to compile or link. You'll need to go back through your output in order to find a hint about the actual root cause.
该Print: Entry, ":CFBundleIdentifier", Does Not Exist
消息仅表明您的项目未能编译或链接。您需要返回输出以找到有关实际根本原因的提示。
If you're having problems, look at the full build output, not just the last few lines. You may want to open the project in Xcode and hit ?B to build it. The build errors in Xcode should help you find the root cause of the failure.
如果您遇到问题,请查看完整的构建输出,而不仅仅是最后几行。您可能想在 Xcode 中打开项目并点击 ?B 来构建它。Xcode 中的构建错误应该可以帮助您找到失败的根本原因。
回答by Charlle
If you've received this error, then you probably do not have the correct path for your application.
如果您收到此错误,则您的应用程序可能没有正确的路径。
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
处理命令时遇到错误(域=NSPOSIXErrorDomain,代码=2):无法安装请求的应用程序 在提供的路径中找不到应用程序包。提供所需应用程序包的有效路径。打印:条目,“:CFBundleIdentifier”,不存在
React Native has hardcoded it as part of their run-ios command in runIOS.js
React Native 已将其硬编码为 runIOS.js 中的 run-ios 命令的一部分
build/Build/Products/${configuration}-${isDevice ? 'iphoneos' : 'iphonesimulator'}/${appName}.app
Unfortunately, Xcode has different build paths depending on your configuration and on whether you are using an Xcode Project or Workspace. I believe the default path for an Xcode Project is build/Products
.
I submitted this pull request 11899to give programmers more flexibility from the CLI.
不幸的是,Xcode 有不同的构建路径,具体取决于您的配置以及您使用的是 Xcode 项目还是工作区。我相信 Xcode 项目的默认路径是build/Products
.
我提交了这个拉取请求11899,以从 CLI 给程序员更多的灵活性。