Xcode 抱怨 Bundle Identifier 中的无效字符
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10421230/
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
Xcode complaining about invalid character in the Bundle Identifier
提问by Vibhor Goyal
When I try to build a Mac OS project in Xcode 4.3.2, it throws out the following warning:
当我尝试在 Xcode 4.3.2 中构建 Mac OS 项目时,它抛出以下警告:
invalid character '$' in Bundle Identifier at column 4. This string must be a uniform type identifier (UTI) that contains only alphanumeric (A-Z,a-z,0-9), hyphen (-), and period (.) characters.
第 4 列的捆绑标识符中的无效字符“$”。此字符串必须是统一类型标识符 (UTI),仅包含字母数字 (AZ,az,0-9)、连字符 (-) 和句点 (.) 字符。
The Bundle identifier for this project is:
这个项目的 Bundle 标识符是:
com.${COMPANY_NAME}.${PRODUCT_IDENTIFIER:rfc1034identifier}
com.${COMPANY_NAME}.${PRODUCT_IDENTIFIER:rfc1034identifier}
Is there anything wrong with the Bundle Identifier, that is specified in the plist?
在 plist 中指定的 Bundle Identifier 有什么问题吗?
回答by Ryan H.
Note that it is perfectly valid to use _in variable names.
请注意,_在变量名称中使用它是完全有效的。
This warning occurs afterthe plist has been parsed and the ${VARIABLES}have been replaced with their respective values. You would therefore need to check the actual values of these variables to make sure they do not contain illegal characters such as _.
在解析 plist 并将其替换为各自的值后,会出现此警告${VARIABLES}。因此,您需要检查这些变量的实际值以确保它们不包含非法字符,例如_.
For the bundle identifier, you can click on your project name in Xcode's file explorer (the first line), select the appropriate target under the TARGET section, then select the General tab. Under Identity/Bundle Identifiercheck the value.
对于包标识符,您可以在 Xcode 的文件资源管理器(第一行)中单击您的项目名称,在 TARGET 部分下选择适当的目标,然后选择 General 选项卡。在身份/捆绑标识符下检查值。
回答by Mick MacCallum
Open your info.plist file and Edit the string that currently says "com.${COMPANY_NAME}.${PRODUCT_IDENTIFIER:rfc1034identifier}".
打开您的 info.plist 文件并编辑当前显示为“com.${COMPANY_NAME}.${PRODUCT_IDENTIFIER:rfc1034identifier}”的字符串。
Completely remove this string and manually enter the bundle id that you created in the iOS provisioning portal.
完全删除此字符串并手动输入您在 iOS 配置门户中创建的包 ID。


