一切都适用于该应用程序的Android版本。我正在使用VS代码使用Flutter开发应用程序,然后使用Azure DevOps构建应用程序,最后将其发布到AppCenter。
与Android相比,IOS不会创建IPA文件,而只会构建Runner.app。因此,在Azure DevOps中,我使用以下代码构建应用程序:
trigger:
- master
pool:
vmImage: 'macos-latest'
steps:
- task: CocoaPods@0
inputs:
workingDirectory: './ios'
forceRepoUpdate: false
- task: MobileDevOpsKeychanger@0
inputs:
KeyChangerPassword: '$(keychangerpw)'
DoAndroidSigning: false
DoAppleDistribution: true
AppleAppIdDistribution: '[myBundleID]'
DoAppleEnterprise: false
- task: FlutterInstall@0
inputs:
channel: 'beta'
version: 'latest'
- task: FlutterBuild@0
inputs:
target: 'ios'
projectDirectory: '.'
iosCodesign: false
- task: CmdLine@2
inputs:
script: |
mkdir -p Payload
mv ./build/ios/iphoneos/Runner.app Payload
zip -r -y Payload.zip Payload/Runner.app
mv Payload.zip Payload.ipa
rm -Rf Payload
- task: CopyFiles@2
inputs:
Contents: '**/*.ipa'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
但是不幸的是,当我对IOS进行同样的操作时,出现此错误:
6851704Z ## [错误]“ {\”状态\“:\”错误\“,\”消息\“:\”无法从版本创建版本。请确保您的.ipa文件格式正确。\“}” http响应代码:422
答案 0 :(得分:0)
该解决方案已在https://github.com/flutter/flutter/issues/13065
中提及首先,我必须使用
将Runner.app转换为ipa。xcodebuild -workspace Runner.xcworkspace -scheme Runner -sdk iphoneos -configuration Release archive -archivePath $PWD/build/Runner.xcarchive
xcodebuild -exportArchive -archivePath $PWD/build/Runner.xcarchive -exportOptionsPlist exportOptions.plist -exportPath $PWD/build/Runner.ipa
并在ios目录上创建文件exportOptions.plist。