升级到xcode 9后,将无法构建cordova应用程序,错误70,需要配置文件 [英] After upgrading to xcode 9, cordova app won't build, error 70, requires provisioning profile

查看:627
本文介绍了升级到xcode 9后,将无法构建cordova应用程序,错误70,需要配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天我们从xcode 8.3.2升级到版本9.现在我们的企业分发apache cordova ios app拒绝构建。

Yesterday we upgraded from xcode 8.3.2 to version 9. And now our enterprise distribution apache cordova ios app refuses to build.

2017-09-21 07:37:16.787 xcodebuild[70400:217569] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path '/var/folders/wj/yj3cfvh954gbc_btlhcrcx7nk7t4dj/T/App Name_2017-09-21_07-37-16.786.xcdistributionlogs'.
2017-09-21 07:37:16.938 xcodebuild[70400:217569] [MT] IDEDistribution: Step failed: <IDEDistributionSigningAssetsStep: 0x7ff756bbdf70>: Error Domain=IDEDistributionSigningAssetStepErrorDomain Code=0 "Locating signing assets failed." UserInfo={NSLocalizedDescription=Locating signing assets failed., IDEDistributionSigningAssetStepUnderlyingErrors=(
    "Error Domain=IDEProvisioningErrorDomain Code=9 \"\"App Name.app\" requires a provisioning profile.\" UserInfo={NSLocalizedDescription=\"App Name.app\" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the \"provisioningProfiles\" dictionary in your Export Options property list.}"
)}
error: exportArchive: "App Name.app" requires a provisioning profile.

Error Domain=IDEProvisioningErrorDomain Code=9 ""App Name.app" requires a provisioning profile." UserInfo={NSLocalizedDescription="App Name.app" requires a provisioning profile., NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options property list.}

** EXPORT FAILED **

Error: Error code 70 for command: xcodebuild with args: -exportArchive,-archivePath,App Name.xcarchive,-exportOptionsPlist,/Users/Shared/Workspace/github/AppName/platforms/ios/exportOptions.plist,-exportPath,/Users/Shared/Workspace/github/AppName/platforms/ios/build/device

(我用这个问题的App Name替换了应用名称)

(I replaced the apps name with "App Name" for this question)

我已经验证所有的证书和配置文件都是在xcode中设置的。并且build.json已设置。我不是一个真正的Mac家伙,我很难接下来要做什么。

I have verified that all the certs and provisioning profiles are set in xcode. And the build.json is set. I'm not really a Mac guy and I'm stumped on what to do next.

-Edit,将xcode降级到8.3.3解决了这个问题。不是一个理想的解决方案,但我无能为力。

-Edit, Downgrading xcode to 8.3.3 fixed the problem. Not an ideal solution but not much I can do.

推荐答案

如果您明确指定配置文件,就像我一样。在你的Cordova build.json中这样:

If you specify your provisioning profile explicitly, like me. Like this in your Cordova build.json:

"ios": {
    "debug": {
        "codeSignIdentitiy": "iPhone Developer",
        "developmentTeam":"MYTEAMID",
        "packageType": "developer",
        "iCloudContainerEnvironment": "Development"
    },
    "release": {
        "codeSignIdentitiy": "iPhone Distribution",
        "developmentTeam":"MYTEAMID",
        "provisioningProfile": "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
        "packageType": "ad-hoc",
        "iCloudContainerEnvironment": "Production"
    }
}

请注意
iCloudContainerEnvironment =只有在使用推送通知时才需要生产/开发

Please Note iCloudContainerEnvironment = Production/Development is only required if you use push notifications

您需要明确设置手动签名,并在Cordova生成的ExportOptions.plist中提供配置密钥。不幸的是,Cordova目前没有生成所有必需的密钥。

You need to explicitly set manual signing and provide the provisioning keys in your ExportOptions.plist that is generated by Cordova. Unfortunately Cordova is not currently generating all of the required keys.

这是它需要的样子,至少对我而言:

Here is what it needs to look like, at least for me:

<?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>ad-hoc</string>
  <key>iCloudContainerEnvironment</key >
  <string>Production</string>
  <key>provisioningProfiles</key>
  <dict>
    <key>my.bundle.idenifier</key>
    <string>My Provisioning Profile Name</string>
  </dict>
  <key>signingCertificate</key>
  <string>iPhone Distribution</string>
  <key>signingStyle</key>
  <string>manual</string>
  <key>stripSwiftSymbols</key>
  <true/>
  <key>teamID</key>
  <string>YOURTEAMID</string>
  <key>thinning</key>
  <string>&lt;none&gt;</string>
</dict>
</plist>

Cordova生成的文件@ cordova / app / platforms / ios / exportOptions.plist如下所示:

The file Cordova generates @ cordova/app/platforms/ios/exportOptions.plist looks like:

<?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>teamID</key>
    <string>MYTEAMID</string>
  </dict>
</plist>

注意它缺少Xcode 9所需的重要位。

notice it is missing the important bits that Xcode 9 requires.

我通过手动归档构建生成了正确的文件,然后导出它也创建了我现在用作引用的exportOptions.plist。

I generated the correct file by archiving the build manually, then exporting it which also creates the exportOptions.plist that I now use as reference.

经过深入研究后,我发现在运行Cordova add platform iOS后无法解决这个问题,因为它是在构建阶段动态生成的。我决定分叉Cordova-ios repo并提交拉取请求。您可以直接使用我的分叉,或者等到拉合请求合并。

After digging deeper, I found that this cannot be fixed after running "Cordova add platform iOS", because it is generated during the build phase dynamically. I decided to fork the Cordova-ios repo and submit a pull request. You may use my fork directly, or wait until the pull request is merged.

拉取请求
https://github.com/apache/cordova-ios/pull/338/commits

Fork
https://github.com/jrryhrtn/cordova-ios

来自请求的使用说明

请参阅下面的示例,请注意,配置文件可以是配置文件的名称或UUID。名称是维护的首选,因为UUID每次都会更改以重新生成配置文件。

See example below, please note that the provisioning profile can be the name or UUID of the profile. Name is preferred for maintenence, as UUID changes each time to regenerate the profile.

{
"ios": {
    "debug": {
        "codeSignIdentity": "iPhone Developer",
        "developmentTeam":"YOURTEAMID",
        "provisioningProfile": "provisioning profile name or UUID",
        "packageType": "development"
    },
    "release": {
        "codeSignIdentity": "iPhone Distribution",
        "developmentTeam":"YOURTEAMID",
        "provisioningProfile": "provisioning profile name or UUID",
        "packageType": "ad-hoc"
    }
}
}

我计划手动修补,直到/ a修复程序合并到下一个Cordova版本中。通过Cordova platform rm iOS然后Cordova platform add~ / forks / cordova-ios,你必须在补丁之后重新生成你的iOS平台。 〜/ forks / cordova-ios我的本地路径,使用您下载分叉Cordova-ios仓库的本地机器上的路径。

I plan to manually patch until the/a fix is merged into the next Cordova release. You will have to regenerate your iOS platform after the patch via "Cordova platform rm iOS" and then "Cordova platform add ~/forks/cordova-ios". ~/forks/cordova-ios my local path, use the path on your local machine where you downloaded the forked Cordova-ios repo.

更新

cordova-ios 4.5.2已正式发布!通过运行以下命令升级:cordova platform rm ios,然后cordova platform add ios@4.5.2

cordova-ios 4.5.2 has been officially released! Upgrade by running the following commands: "cordova platform rm ios", and then "cordova platform add ios@4.5.2"

干杯!

这篇关于升级到xcode 9后,将无法构建cordova应用程序,错误70,需要配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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