简体   繁体   English

如何确保应用程序 info.plist 包含 CFBundleIdentifier 的值?

[英]How to Ensure the apps info.plist contains a value for CFBundleIdentifier?

The app will not run on the simulator or the device but the trouble started when i went to get it on device.该应用程序不会在模拟器或设备上运行,但当我去设备上获取它时,问题就开始了。 Running the latest and greatest Xcode and macOS.运行最新最好的 Xcode 和 macOS。 Any suggestions are most welcome.欢迎提出任何建议。

挑战

在此处输入图像描述

I suspect this issue is related to the unit testing targets but there is also odd behaviour in the "Signing and Capabilities", when i type in the bundle identifier "com.sw.fw" and hit enter the text in the the textfield vanishes and the "Signing (Release)" duplication appears below with that bundle id.我怀疑这个问题与单元测试目标有关,但在“签名和功能”中也有奇怪的行为,当我输入包标识符“com.sw.fw”并点击输入时,文本字段中的文本消失并且“签名(发布)”副本与该捆绑包 ID 一起出现在下方。 I also created a fresh mobile provisioning profile with the appropriate bundle id com.sw.fw我还使用适当的捆绑 ID com.sw.fw创建了一个新的移动配置文件

I also know that Xcode is doing something with the bundle id that i'm giving it because it appears on the Certificates, Identifiers & Profiles page of developer.apple.com as can be seen here.我也知道 Xcode 正在使用我给它的 bundle id 做一些事情,因为它出现在developer.apple.comCertificates, Identifiers & Profiles页面上,如下所示。

developer.apple.com 网站

Here's the target signing after hitting enter.这是点击回车后的目标签名。

目标签名

Here's the "Build Settings" for the target这是目标的“构建设置”

为目标构建设置

Here's my info.plist it is the same as an app i have running on device.这是我的 info.plist,它与我在设备上运行的应用程序相同。

信息.plist

Here's a unit test signing这是一个单元测试签名

测试签名

Here's the "Build Settings" for a unit test target这是单元测试目标的“构建设置”

测试构建设置

App Targets "General" pane doesn't let me type anything in the Bundle Identifier Field. App Targets“General”面板不允许我在 Bundle Identifier Field 中输入任何内容。 You can see it reads <Multiple Values> .您可以看到它显示为<Multiple Values>

在此处输入图像描述

I have faced the same error and I figured out that I have missed to add or somehow removed GoogleService-Info.plist file from my project while I am using firebase in my application.我遇到了同样的错误,我发现当我在我的应用程序中使用 firebase 时,我错过了添加或以某种方式从我的项目中删除了GoogleService-Info.plist文件。 You might be doing the same thing.你可能正在做同样的事情。

check your Product Bundle Identifier from Build Settings, they might have different values for different builds.从构建设置中检查您的产品包标识符,它们对于不同的构建可能具有不同的值。 Changing the bundle identifier to be the same should solve this issue.将捆绑标识符更改为相同应该可以解决此问题。 In your case removing the 'Any SDK' under debug.在您的情况下,删除调试下的“任何 SDK”。

enter image description here在此处输入图像描述

It looks as if your .xcodeproj container was messed up.看起来好像你的.xcodeproj容器搞砸了。

Some options:一些选项:

  • Make sure all targets (including tests and extensions) have the product bundle identifier set in their Info.plist files.确保所有目标(包括测试和扩展)都在其Info.plist文件中设置了产品包标识符。

  • Try to set the product bundle identifier only in the target's Signing and Capabilities field instead of manually editing it in different places.尝试仅在目标的Signing and Capabilities字段中设置产品捆绑标识符,而不是在不同的地方手动编辑它。 Otherwise you risk introducing inconsistencies.否则,您将面临引入不一致的风险。

  • If you want to dig into project.pbxpro you could search for the PRODUCT_BUNDLE_IDENTIFIER key and manually check the entries.如果您想深入了解project.pbxpro ,您可以搜索PRODUCT_BUNDLE_IDENTIFIER键并手动检查条目。 Compare with a fresh Xcode project on where/how you expect to find the key.与新的 Xcode 项目进行比较,了解您希望在何处/如何找到密钥。

  • You can go by elimination and remove targets / custom configurations from the original project until it installs successfully.您可以通过消除 go 并从原始项目中删除目标/自定义配置,直到它成功安装。

  • Create a fresh Xcode project and move your code over.创建一个新的 Xcode 项目并移动您的代码。

Target > Build Settings > Info plist file目标 > 构建设置 > 信息 plist 文件

Check Info.plist file path检查 Info.plist 文件路径

image图片

Target > Build Settings > Packaging目标 > 构建设置 > 打包

In "Info.plist File" add "Target_Name/Info.plist"在“Info.plist 文件”中添加“Target_Name/Info.plist”

在此处输入图像描述

In my case, the message was not corresponding precisely to the problem.就我而言,消息与问题并不完全对应。
First, my Launch Screen in the General settings of the target was not good.首先,我在目标的常规设置中的启动屏幕不好。
In second, I checked my Splashscreen.png that was missing, and I removed it.其次,我检查了丢失的 Splashscreen.png,然后删除了它。 Then it worked perfectly.然后它完美地工作。
I advice to check if there is an element missing in the ressource etc...我建议检查资源等中是否缺少元素...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 确保应用程序的 Info.plist 包含 CFBundleIdentifier 的值。 打印:条目,“:CFBundleIdentifier”,不存在 - Ensure that the application's Info.plist contains a value for CFBundleIdentifier. Print: Entry, ":CFBundleIdentifier", Does Not Exist 有没有办法在Info.plist文件的其他地方引用CFBundleIdentifier? - Is there a way to refer to the CFBundleIdentifier elsewhere in the Info.plist file? Xcode 7错误:无法从Info.plist中读取CFBundleIdentifier(null) - Xcode 7 error: could not read CFBundleIdentifier from Info.plist (null) 排毒:在 Info.plist 中找不到字段 CFBundleIdentifier - Detox: field CFBundleIdentifier not found inside Info.plist Framework的Info.plist中没有CFBundleIdentifier - Framework did not have a CFBundleIdentifier in its Info.plist 错误:包中的 Info.plist 必须包含 CFBundleIdentifier 键 - Error: The Info.plist in the package must contain the CFBundleIdentifier key iOS-如何使URL链接在info.plist值中可点击 - iOS - How to make url link clickable in info.plist value 如何在 info.plist 文件中使用 Code 值 xcode ios - How to use Code value in the info.plist file xcode ios 如何在info.plist中创建多项选择键值 - How to create a multiple choice key-value in info.plist 框架使用Swift和Cocoapods在Info.plist中没有CFBundleIdentifier - framework did not have a CFBundleIdentifier in its Info.plist using Swift and Cocoapods
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM