代码签名错误:SDK'iOS 11.0'中的产品类型'Application'需要代码签名 [英] Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.0'

查看:95
本文介绍了代码签名错误:SDK'iOS 11.0'中的产品类型'Application'需要代码签名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用GitLab CI来自动构建适用于Android和iOS的应用程序。我的iOS命令行构建始终失败,并显示以下错误:



代码签名错误:SDK中的产品类型应用需要代码签名iOS 11.0'



我正在使用 master 分支> cordova-ios GitHub。由于它具有以下修复程序,如此处所述:升级到xcode 9后,cordova应用将无法构建,错误70,需要配置配置文件



在我的 build.json 我使用以下设置:

  {
android:{
debug:{
keystore: config / android.keystore,
storePassword:< pass>,
alias:调试,
password:< pass>,
keystoreType:
},
release:{
keystore: config / android.keystore,
storePassword:< pass>,
alias: release,
password:< ; pass>,
keystoreType:
}
},
ios:{
debug:{
codeSignIdentity: iPhone Developer,
developmentTeam:< team id>,
packageType: development,
buildFlag:[
EMBEDDED_CONTENT_CONTAINS_SWIFT =是,
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO,
LD_RUNPATH_SEARCH_PATHS = \ @ executable_path / Framework,
b $ b iCloudContainerEnvironment:开发
},
版本:{
codeSignIdentity: iPhone开发人员,
developmentTeam:< team id>,
packageType:应用程序商店,
buildFlag:[
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES,
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO,
LD_RUNPATH_SEARCH_PATHS = \ @@ executable_path / Frameworks\
],
iCloudContainerEnvironment: 生产
}
}
}

我确实使用 iCloudContainerEnvironment ,因为我需要启用推送。
我还使用正确的配置文件开始了构建过程。我使用CLI参数来执行此操作,因为我为多个不同的应用程序IDS构建了该应用程序: cordova build ios --device --provisioningProfile =< uuid>



但是无论我做什么或尝试使用它都不会签名应用,并不断抛出错误。



编辑:



基于@Jerry Horton的建议,我将配置文件添加到了 build.json 文件中。我尝试使用配置文件名称和配置文件UUID。两种情况都引发以下错误,并且在 platforms / ios / 目录中找不到 exportOptions.plist 。 / p>


代码签名错误:配置文件 iOS Team Provisioning Profile:nl.XXX.loc.app由Xcode管理,但已签名设置需要手动管理的配置文件。



我什至删除了所有插件,以确保它们没有任何障碍。所以我的 build.json 现在看起来像这样:

  {
android:{
debug:{
keystore: config / android.keystore,
storePassword:< pass>,
alias:调试,
password:< pass>,
keystoreType:
},
release:{
keystore: config / android.keystore,
storePassword:< pass>,
alias: release,
password: < pass>,
keystoreType:
}
},
ios:{
debug:{
codeSignIdentity: iPhone开发者,
developmentTeam:< team id>,
provisioningProfile:< nl.XXX.loc.app或UUID>,
packageType:开发,
buildFlag:[
EMBEDDED_CONTENT_CONTAINS_SW IFT =是,
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO,
LD_RUNPATH_SEARCH_PATHS = \ @ executable_path / Frameworks\
],
iCloudContainerEnvironment:开发
},
发行:{
codeSignIdentity: iPhone开发人员,
developmentTeam:< team id>,
packageType :应用程序商店,
provisioningProfile:< nl.XXX.app或UUID>,
buildFlag:[
EMBEDDED_CONTENT_CONTAINS_SWIFT = YES,
ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = NO,
LD_RUNPATH_SEARCH_PATHS = \ @ executable_path / Frameworks\
],
iCloudContainerEnvironment:生产
}
}
}

ExportOptions.plist:



当我手动打开op XCode并创建弧时配置单元/导出以进行手动调试我确实获得了IPA,并且在此文件夹中有一个 ExportOptions.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> compileBitcode< / key>
< false />
< key>方法< / key>
< string> development< / string>
< key> provisioningProfiles< / key>
< dict>
< key> nl.XXX.loc.app< / key>
< string> nl.XXX.loc.app< / string>
< / dict>
< key> signingCertificate< / key>
< string> iPhone Developer< / string>
< key> signingStyle< / key>
< string> manual< / string>
< key> stripSwiftSymbols< / key>
< true />
< key> teamID< / key>
< string> TEAMID< / string>
< key> thinning< / key>
< string>& lt; none& gt;< / string>
< / dict>
< / plist>

我真的看不到这里有什么问题。也许是细化部分?

解决方案

您需要在build.json文件中指定配置文件,以便exportOptions.plist文件将在Cordova构建阶段正确生成。尝试一个变体以查看其是否有效,然后您可能希望为每个应用程序构建变体保留build.json的变体。这实际上是我在我们的项目中所做的。我们的grunt构建脚本在 cordova添加平台和 cordova构建之前将build-.json复制到build.json。

  provisioningProfile:提供配置文件名称或UUID 

运行Cordova build命令后,成功或失败exportOptions.plist生成@

  cordova / app / platforms / ios / exportOptions.plist 

我发现它很有帮助将此作为调试工具进行审核。


I am using GitLab CI to automatically build an application for Android and iOS. My command line builds for iOS keeps failing with the error:

Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.0'

I am using the master branch from cordova-ios GitHub. Since this has the following fix, like stated here: After upgrading to xcode 9, cordova app won't build, error 70, requires provisioning profile

In my build.json I use the following settings:

{
    "android": {
        "debug": {
            "keystore": "config/android.keystore",
            "storePassword": "<pass>",
            "alias": "debug",
            "password" : "<pass>",
            "keystoreType": ""
        },
        "release": {
            "keystore": "config/android.keystore",
            "storePassword": "<pass>",
            "alias": "release",
            "password" : "<pass>",
            "keystoreType": ""
        }
    },
    "ios": {
        "debug": {
            "codeSignIdentity": "iPhone Developer",
            "developmentTeam": "<team id>",
            "packageType": "development",
            "buildFlag": [
                "EMBEDDED_CONTENT_CONTAINS_SWIFT = YES",
                "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO",
                "LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\""
            ],
            "iCloudContainerEnvironment": "Development"
        },
        "release": {
            "codeSignIdentity": "iPhone Developer",
            "developmentTeam": "<team id>",
            "packageType": "app-store",
            "buildFlag": [
                "EMBEDDED_CONTENT_CONTAINS_SWIFT = YES",
                "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO",
                "LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\""
            ],
            "iCloudContainerEnvironment": "Production"
        }
    }
}

I do use the iCloudContainerEnvironment because I need push enabled. Als I start the build process using the correct provisioning profile. I do this with the CLI parameter, because I build the app for several different app IDS: cordova build ios --device --provisioningProfile=<uuid>

But no matter what I do or try it does not sign the app and keeps throwing the error.

EDIT:

Based on @Jerry Horton suggestion I added the provisioning profile into the build.json file. I tried it with the profile name and the profile UUID. Both situation throw the following error and no exportOptions.plist is to be found in the platforms/ios/ dir:

Code Signing Error: Provisioning profile "iOS Team Provisioning Profile: nl.XXX.loc.app" is Xcode managed, but signing settings require a manually managed profile.

I even removed all the plugins to be sure none of them stand in the way. So my build.json looks like this now:

{
    "android": {
        "debug": {
            "keystore": "config/android.keystore",
            "storePassword": "<pass>",
            "alias": "debug",
            "password" : "<pass>",
            "keystoreType": ""
        },
        "release": {
            "keystore": "config/android.keystore",
            "storePassword": "<pass>",
            "alias": "release",
            "password" : "<pass>",
            "keystoreType": ""
        }
    },
    "ios": {
        "debug": {
            "codeSignIdentity": "iPhone Developer",
            "developmentTeam": "<team id>",
            "provisioningProfile": "<nl.XXX.loc.app or UUID>",
            "packageType": "development",
            "buildFlag": [
                "EMBEDDED_CONTENT_CONTAINS_SWIFT = YES",
                "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO",
                "LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\""
            ],
            "iCloudContainerEnvironment": "Development"
        },
        "release": {
            "codeSignIdentity": "iPhone Developer",
            "developmentTeam": "<team id>",
            "packageType": "app-store",
            "provisioningProfile": "<nl.XXX.app or UUID>",
            "buildFlag": [
                "EMBEDDED_CONTENT_CONTAINS_SWIFT = YES",
                "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO",
                "LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\""
            ],
            "iCloudContainerEnvironment": "Production"
        }
    }
}

ExportOptions.plist:

When I manual open op XCode and create an archive/export for debug manually I do get an IPA and within this folder there is an ExportOptions.plist, like this:

<?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>compileBitcode</key>
    <false/>
    <key>method</key>
    <string>development</string>
    <key>provisioningProfiles</key>
    <dict>
            <key>nl.XXX.loc.app</key>
            <string>nl.XXX.loc.app</string>
    </dict>
    <key>signingCertificate</key>
    <string>iPhone Developer</string>
    <key>signingStyle</key>
    <string>manual</string>
    <key>stripSwiftSymbols</key>
    <true/>
    <key>teamID</key>
    <string>TEAMID</string>
    <key>thinning</key>
    <string>&lt;none&gt;</string>
</dict>
</plist>

I really can't see what is wrong here. Maybe the thinning part?

解决方案

You need to specify the provisioning profile in your build.json file in order for the exportOptions.plist file to be generated correctly during the Cordova build phase. Try it with one variation to see if it works, then you may want to keep variations of build.json for each application build variant. This is actually what I do in our projects. Our grunt build script copies build-.json to build.json prior to "cordova add platform", and "cordova build".

"provisioningProfile": "provisioning profile name or UUID"

After the Cordova build command is run, succeed or fail the exportOptions.plist is generated @

cordova/app/platforms/ios/exportOptions.plist

I found it helpful to review this as a debugging tool.

这篇关于代码签名错误:SDK'iOS 11.0'中的产品类型'Application'需要代码签名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆