ios – Flutter Pipeline in Azure DevOps (Task Xcode build IPA)

0
41


I am trying to build my flutter iOS App.

I am running an azure devops pipeline that builds app ios .ipa. Try various methods I found on the internet
I did the steps of the official documentation and other examples found and I have this error.
sorry for my English.

pool:
  vmImage: macOS-latest

stages:

- stage: iOSStage
  dependsOn: []
  displayName: iOS
  jobs:
 
  - job: iOSJob
    displayName: iOS
    steps:

    - task: InstallAppleCertificate@2
      inputs:
        certSecureFile: 'Certificates.p12'
        certPwd: '$(p12_pass)'
        keychain: 'temp'

    - task: InstallAppleProvisioningProfile@1
      displayName: Install provisioning file
      name: ProvisionProfile
      inputs:
        provisioningProfileLocation: 'secureFiles'
        provProfileSecureFile: 'Ad_Hoc_distribution_provisioning_profile.mobileprovision'

    - task: FlutterInstall@0
      inputs:
          mode: 'auto'
          channel: 'stable'
          version: 'custom'
          customVersion: '3.0.5'

    - task: FlutterCommand@0
      inputs:
        projectDirectory: './ios'
        flutterDirectory: './ios'
        arguments: 'clean'

    - task: FlutterCommand@0
      inputs:
        projectDirectory: './ios'
        arguments: 'pub get'

    - task: CocoaPods@0
      inputs:
        forceRepoUpdate: false
        workingDirectory: ./ios
        projectDirectory: ./ios

    - task: FlutterBuild@0
      displayName: "Flutter Build Apps - iOS"
      inputs:
          target: "ios"
          buildName: "$(Build.BuildNumber)"
          entryPoint: 
          iosCodesign: true
          iosTargetPlatform: simulator
          buildFlavour: qa
          extraArgs: --flavor $(buildFlavourtype)
          exportOptionsPlist: ./ios/Flutter/AppFrameworkInfo.plist
          debugMode: true[enter image description here][1]

    - task: Xcode@5
      inputs:
        actions: 'clean'
        packageApp: true
        xcWorkspacePath: './ios/Runner.xcworkspace'
        signingOption: manual
        sdk: $(SDK)
        configuration: "release"
        scheme: $(buildFlavourtype)
        provisioningProfileUuid: $(APPLE_PROV_PROFILE_UUID)
        signingIdentity: $(APPLE_CERTIFICATE_SIGNING_IDENTITY)
        TeamId: $(TeamId)
        exportOptionsPlist: ./ios/Flutter/AppFrameworkInfo.plist        #'./ios/Runner/Info.plist'
        exportOptions: ./ios/Flutter/AppFrameworkInfo.plist
        args: CODE_SIGNING_ALLOWED=No CODE_SIGNING_REQUIRED=No EXPANDED_CODE_SIGN_IDENTITY="" -allowProvisioningUpdates

    - task: CopyFiles@2
      displayName: "Copy app to staging directory"
      inputs:
        sourceFolder: '$(Agent.BuildDirectory)'
        contents: '**/ipa/*.ipa'
        targetFolder: '$(Build.StagingDirectory)'
        flattenFolders: true

    - task: PublishBuildArtifacts@1
      displayName: "Publish IPA file"
      inputs:
        PathtoPublish: '$(Build.ArtifactStagingDirectory)'
        ArtifactName: 'IPA'
        publishLocation: 'Container'

And the failing Xcode archive task:

Task Xcode build

- task: FlutterCommand@0
      inputs:
        projectDirectory: '.'
        arguments: 'build ipa --release --build-name=1.0 --build-number 1 --export-options-plist=./ios/Flutter/AppFrameworkInfo.plist --target=lib/main_qa.dart --flavor qa '

Flutter build ipa

Also

 - task: FlutterBuild@0
      displayName: "Flutter Build Apps - iOS"
      inputs:
          target: "ipa"
          buildName: "$(Build.BuildNumber)"
          entryPoint: "$(buildtype)"
          iosCodesign: true
          iosTargetPlatform: simulator
          buildFlavour: qa
          extraArgs: --flavor $(buildFlavourtype)
          exportOptionsPlist: ./ios/Flutter/AppFrameworkInfo.plist
          debugMode: true

code build

pubspect.yaml


name: XXX
description: XXX

# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
# followed by an optional build number separated by a +.
# Both the version and the builder number may be overridden in flutter
# build by specifying --build-name and --build-number, respectively.
# In Android, build-name is used as versionName while build-number used as versionCode.
# Read more about Android versioning at https://developer.android.com/studio/publish/versioning
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.0+1

environment:
  sdk: ">=2.16.2 <3.0.0"

# Dependencies specify other packages that your package needs in order to work.
# To automatically upgrade your package dependencies to the latest versions
# consider running `flutter pub upgrade --major-versions`. Alternatively,
# dependencies can be manually updated by changing the version numbers below to
# the latest version available on pub.dev. To see which dependencies have newer
# versions available, run `flutter pub outdated`.
dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.2
  # State managment
  flutter_bloc: ^8.0.1
  bloc: ^8.0.3
  get_it: ^7.2.0
  # Storage
  flutter_secure_storage: ^5.0.2
  shared_preferences: ^2.0.13
  # Utils
  either_dart: ^0.1.4
  dio: ^4.0.6
  equatable: ^2.0.3
  flutter_localizations:
    sdk: flutter
  intl: ^0.17.0
  sizer: ^2.0.15
  faker: ^2.0.0
  logger: ^1.1.0
  clipboard: ^0.1.3
  url_launcher: ^6.1.5
  flutter_stripe: ^4.0.0
  flutter_stripe_web: ^1.2.0
  # Widgets
  pinput: ^2.2.7
  intl_phone_field: ^3.1.0
  flutter_platform_widgets: ^1.20.0
  card_swiper: ^2.0.3
  flutter_animation_progress_bar: ^2.1.1
  flutter_countdown_timer: ^4.1.0
  accordion: ^2.3.0
  flutter_svg: ^1.0.3
  flutter_portal: ^1.0.0
  badges: ^2.0.3
  country_icons: ^2.0.2


dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^1.0.0
  bloc_test: ^9.0.3
  test: ^1.16.0
  flutter_launcher_icons: ^0.9.2

flutter_icons:
  android: true
  ios: false
  min_sdk_android: 21
  image_path_ios: "assets/icons/ios_launcher.png"
  adaptive_icon_background: '#000000'
  remove_alpha_ios: true
  image_path: "assets/icons/icon_launcher.png"

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true
  generate: true


  # To add assets to your application, add an assets section, like this:
  assets:
    - assets/
    - assets/icons/
    - assets/helmets/

  # An image asset can refer to one or more resolution-specific "variants", see
  # https://flutter.dev/assets-and-images/#resolution-aware.

  # For details regarding adding assets from package dependencies, see
  # https://flutter.dev/assets-and-images/#from-packages

  # To add custom fonts to your application, add a fonts section here,
  # in this "flutter" section. Each entry in this list should have a
  # "family" key with the font family name, and a "fonts" key with a
  # list giving the asset and other descriptors for the font. For
  # example:
  # fonts:
  #   - family: Schyler
  #     fonts:
  #       - asset: fonts/Schyler-Regular.ttf
  #       - asset: fonts/Schyler-Italic.ttf
  #         style: italic
  #   - family: Trajan Pro
  #     fonts:
  #       - asset: fonts/TrajanPro.ttf
  #       - asset: fonts/TrajanPro_Bold.ttf
  #         weight: 700
  #
  # For details regarding fonts from package dependencies,
  # see https://flutter.dev/custom-fonts/#from-packages