错误:exportArchive:无法完成操作.(IDEDistributionErrorDomain错误3.)

Saz*_*han 8 release build xcodebuild ios

我正在使用xcodebuild在命令行上构建iOS项目.使用Release配置构建可以创建和App.xcarchive.然后我尝试使用,导出App Store IPA的存档,

xcodebuild -exportArchive -archivePath App.xcarchive -exportPath ~/output/ -exportOptionsPlist appstore.plist
Run Code Online (Sandbox Code Playgroud)

我的appstore.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>teamID</key>
<string>T3AM1D</string>
<key>method</key>
<string>app-store</string>
</dict>
</plist
Run Code Online (Sandbox Code Playgroud)

这给了我错误,

错误:exportArchive:无法完成操作.(IDEDistributionErrorDomain错误3.)

任何帮助将不胜感激.

Saz*_*han 6

最后我能够解决这个问题.

解决方案步骤

  1. 确保在Mac中成功设置了所有配置文件和证书
  2. 确保Xcode没有显示红色标记,例如Xcode- > targets- > Build settings- >Profiles and signing identity + team
  3. 确保所有目标(包括MainApp,Widgets,Extensions)都配置没有问题
  4. 确保所有功能,appgroup和钥匙串都正常
  5. 重要提示:确保从Xcode- > Product- > Archive- > export to App Store IPA运行至少一次
  6. 从命令行运行xcodebuild时,请确保Xcode已关闭

希望这可以帮助