Flutter打包报错requires a provisioning profile with the Push Notifications and Sign in with Apple featur



前言

最近参与团队开发,之前一直好用的flutter打包命令居然不好用了,现在把解决方法分享给大家,希望帮助到你。


一、报错及原因

1、我们的打包命令:

flutter build ipa --release --export-method ad-hoc -t lib/flavors/xxx.dart

2、报错如下:

Building ad-hoc IPA...                                             13.8s
Encountered error while creating the IPA:
error: exportArchive: "Runner.app" requires a provisioning profile with the Push Notifications and Sign in with Apple features.


Try distributing the app in Xcode: "open /Users/xxx/Documents/xxx/build/ios/archive/Runner.xcarchive"

二、分析原因

1、为什么现在发现这个问题?因为我们之前都是选自动证书管理,使用上面命令打包不存在这个问题。
2、现在多人开发,使用的是P12证书方式,就得手动选择证书管理,所以导致了这个问题。

三、解决方法

1、首先要创建一个plist文件,然后在命令中指定一下plist文件路径:

flutter build ipa --export-options-plist=ios/export.plist -t lib/flavors/xxxx.dart

2、命令中,我把export.plist放到flutter项目的iOS目录下面
3、可能你会说我没有plist文件,其实plist很好找,你找你之前打包出来Runner.xcarchive文件导出即可。
4、在Xcode中点击Windows----Organizer:
请添加图片描述
5、选择导出就可以得到四个文件:
请添加图片描述
这里的ExportOptions.plist就是你想要的plist文件。
6、当你看到这里时,你就成功地构建了ipa

[✓] App Settings Validation
    • Version Number: 1.1.3
    • Build Number: 13
    • Display Name: xxx
    • Deployment Target: 11.0
    • Bundle Identifier: saletop.com

[!] App Icon and Launch Image Assets Validation
    ! Launch image is set to the default placeholder icon. Replace with unique launch image.

To update the settings, please refer to https://docs.flutter.dev/deployment/ios

Building App Store IPA...                                          16.3s
Built IPA to /Users/xxx/Documents/xxx/build/ios/ipa.
To upload to the App Store either:
    1. Drag and drop the "build/ios/ipa/*.ipa" bundle into the Apple Transporter macOS app https://apps.apple.com/us/app/transporter/id145087478
    2. Run "xcrun altool --upload-app --type ios -f build/ios/ipa/*.ipa --apiKey your_api_key --apiIssuer your_issuer_id".
       See "man altool" for details about how to authenticate with the App Store Connect API key.

总结

这就是flutter到处ipa文件时遇到的问题和解决方法,希望能帮助到你!

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

明似水

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值