Search code examples
fluttermobile-developmentcodemagicflutter-ios-buildshorebird

Flutter - CodeMagic - Shorebird - iOS Build Problem


I want to release my ios app with shorebird codemagic action. But I got an error on Step Name => šŸ™Œ Shorebird Build.

Previously, I could get release without using shorebird.

Error=>

[WARN] iOS support is alpha. See ]8;;https://docs.shorebird.dev/status#ios-alpha\https://docs.shorebird.dev/status#ios-alpha]8;;\ for more information.
ā ‹ Fetching apps...
āœ“ Fetching apps (0.2s)
ā ‹ Building release...
āœ— Failed to build (197.0s)
    No Accounts
    No profiles for 'x.x.x' were found


Build failed :|
Step 11 script `šŸ™Œ Shorebird Build` exited with status code 70

Workflow =>

workflows:
  ios-shorebird-workflow:
    instance_type: mac_mini_m1
    name: iOS ShoreBird Workflow
    environment:
      ios_signing:
        provisioning_profiles:
          - For CodeMagic
        certificates:
          - Code Magic Certificate
      flutter: 3.10.6
      cocoapods: 1.13.0
      xcode: 15.0
      groups:
        - shorebird
        - appstore

    triggering:
      events:
        - tag

    cache:
      cache_paths:
        - $FLUTTER_ROOT/.pub-cache
        - $HOME/Library/Caches/CocoaPods

    integrations:
      app_store_connect: "IOS Codemagic Integration"

    publishing:
      app_store_connect:
        auth: integration
        submit_to_testflight: true

    artifacts:
      - build/ios/ipa/*.ipa

    scripts:
      - name: šŸ¦ Setup Shorebird
        script: |
          # Install Shorebird
          curl --proto '=https' --tlsv1.2 https://raw.githubusercontent.com/shorebirdtech/install/main/install.sh -sSf | bash
          
          # Add Shorebird to PATH
          echo PATH="$HOME/.shorebird/bin:$PATH" >> $CM_ENV

      - name: Shorebird flutter versions set to 3.10.6
        script: |
          shorebird flutter versions use 3.10.6

      - name: Set up code signing settings on Xcode project
        script: |
          xcode-project use-profiles

      - name: Flutter Packages Get and Translations
        script: |
          flutter pub get
          flutter packages pub global activate intl_utils
          flutter --no-color pub global run intl_utils:generate

      - name: Pods Install
        script: |
          rm -rf ios/Podfile.lock
          pod install --repo-update --project-directory=./ios

      - name: šŸ™Œ Shorebird Build
        script: |
          echo "āž”ļø Using tag: $CM_TAG"
          
          # Check type and run corresponding command
          if [ "$TYPE" == *"#"* ]; then
            echo "šŸ©¹ Running patch command"
            shorebird patch ios-alpha --force
          else
            echo "šŸš€ Running release command"
            shorebird release ios-alpha --force
          fi

I tried to get the release without using Shorebird, no problem. I tried signing the application in different ways on the CodeMagic workflow, but the result did not change.


Solution

  • I solved the problem by adding this parameter to shorebird release command

    -- --export-options-plist=/Users/builder/export_options.plist
    

          - name: šŸ™Œ Shorebird Build
            script: |
              echo "āž”ļø Using tag: $CM_TAG"
              
              # Check type and run corresponding command
              if [ "$TYPE" == *"#"* ]; then
                echo "šŸ©¹ Running patch command"
                shorebird patch ios-alpha --force
              else
                echo "šŸš€ Running release command"
                shorebird release ios-alpha --force \
                  -- --export-options-plist=/Users/builder/export_options.plist
              fi