我有一个使用 Qt(QML) 构建的 iOS 应用程序,我想为其使用自定义 Info.plist 文件。
为此,我像往常一样构建项目(导致 QMake 提供默认的 Info.plist 文件)。然后我转到应用程序包(在 .app 文件内)并将生成的 Info.plist 文件复制到我的源代码树中。复制后,我修改了此文件以进行所需的必要自定义(我只是更改了屏幕方向设置,没有其他任何内容)。
我现在指定这个自定义 Info.plist 的路径以在我的应用程序的 .pro 文件中归档,如下所示:
ios{
QMAKE_INFO_PLIST = packages/ios/Info.plist
}
当我现在点击构建时,出现以下编译器错误:
Check dependencies
Code Sign error: Automatic provisioning profile selection unavailable: A bundle identifier is required for automatic provisioning profile selection. Either enter a bundle identifier in the Info.plist, or select a provisioning profile to use in the build settings.
CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 8.2'
有其他人遇到过这个吗?我正在使用 Qt 5.4.1。在 OSX 上构建。
最佳答案
确保您的 Info.plist
副本是 XML 格式,而不是二进制格式。
这是必要的,因为qmake
使用sed
来替换some variables在构建过程中。例如
@sed -e "s,@SHORT_VERSION@,1.0,g" -e "s,@FULL_VERSION@,1.0.0,g" -e "s,@TYPEINFO@,????,g" -e "s,@BUNDLEIDENTIFIER@,com.example.product,g" -e "s,@ICON@,myproduct.icns,g" -e "s,@EXECUTABLE@,MyProduct,g" -e "s,@TYPEINFO@,????,g" ../../project/subproject/Info.plist >MyProject.app/Contents/Info.plist
我打开了一个Qt bug因为 qmake 应该检查它。
关于qt - QMake:为 iOS App 指定自定义 Info.plist 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29385950/