flutter – xcode build error in Github Actions : Xcode couldn’t find any iOS App Development provisioning profiles … why not Distribution profile..?


I’m attempting to automate the iOS deployment of a Flutter project using GitHub Actions. I’ve set up the necessary files in the virtual environment, including the Profile, p12, and p8. However, when I run the flutter build ipa … command, I encounter the error.

I have uploaded the iOS distribution profile to the virtual environment. Is this the source of the problem? Shouldn’t the iOS distribution profile suffice for a release build? What could be causing this issue? Why needed develop profile, not deistribution?

github action yml:

name: dev CICD

on:
  push:
    branches: [ "features/231228_cicd" ]
jobs:
  build:
    runs-on: macos-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        
      - name: 🔐 Install Apple certificate and provisioning profile
        env:
          P12_DISTRIBUTION_CERTIFICATE_BASE64: "${{ secrets.IOS_P12_DISTRIBUTION_CERTIFICATE_BASE64 }}"
          P12_DISTRIBUTION_CERTIFICATE_PASSWORD: "${{ secrets.IOS_P12_DISTRIBUTION_CERTIFICATE_PASSWORD }}"
          DISTRIBUTION_PROVISIONING_PROFILE_BASE64: "${{ secrets.IOS_DISTRIBUTION_PROVISIONING_PROFILE_BASE64 }}"
          LOCAL_NOTI_PROVISIONING_PROFILE_BASE64: "${{ secrets.IOS_LOCAL_NOTIFICATION_PROFILE_BASE64 }}"
          APP_STORE_CONNECT_API_PRIVATE_KEY_BASE64: "${{ secrets.APP_STORE_CONNECT_API_PRIVATE_KEY_BASE64 }}"
          KEYCHAIN_PASSWORD: "${{ secrets.IOS_RUNNER_LOCAL_KEYCHAIN_PASSWORD }}"
          EXPORT_OPTIONS_BASE64: "${{ secrets.IOS_EXPORT_OPTIONS_BASE64 }}"
        run: |
          # create path variables
          CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
          PROVISIONING_PROFILE_PATH=$RUNNER_TEMP/ios_dist_pp.mobileprovision
          LOCAL_NOTIFICATION_PROFILE_PATH=$RUNNER_TEMP/ios_dist_noti_pp.mobileprovision
          KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
          EXPORT_OPTIONS_PATH="${{ github.workspace }}/ios/Runner/ExportOptions.plist"
          APP_STORE_PRIVATE_KEY_PATH=$RUNNER_TEMP/app_store_connect_api_key.p8

          # import certificate, provisioning profile and export options from secrets
          echo -n "$P12_DISTRIBUTION_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
          echo -n "$DISTRIBUTION_PROVISIONING_PROFILE_BASE64" | base64 --decode -o $PROVISIONING_PROFILE_PATH
          echo -n "$LOCAL_NOTI_PROVISIONING_PROFILE_BASE64" | base64 --decode -o $LOCAL_NOTIFICATION_PROFILE_PATH
          echo -n "$EXPORT_OPTIONS_BASE64" | base64 --decode -o $EXPORT_OPTIONS_PATH
          echo -n "$APP_STORE_CONNECT_API_PRIVATE_KEY_BASE64" | base64 --decode -o $APP_STORE_PRIVATE_KEY_PATH

          # create temporary keychain
          security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
          security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
          security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH

          # import certificate to keychain
          security import $CERTIFICATE_PATH -P "$P12_DISTRIBUTION_CERTIFICATE_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
          security list-keychain -d user -s $KEYCHAIN_PATH

          # apply provisioning profile
          mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
          cp $PROVISIONING_PROFILE_PATH ~/Library/MobileDevice/Provisioning\ Profiles
          cp $LOCAL_NOTIFICATION_PROFILE_PATH ~/Library/MobileDevice/Provisioning\ Profiles
      
      - name: Set up JDK 11
        uses: actions/setup-java@v2
        with:
          java-version: '11'
          distribution: 'adopt'
      - uses: subosito/[email protected]
        with:
          flutter-version: '3.3.1'
          
      - name: Install packages
        run: flutter pub get

      - name: Build ios dev
        run: |
          flutter build ipa \
            --release \
            --flavor dev \
            --export-options-plist=ios/Runner/ExportOptions.plist
      
      - name: path test1
        run: ls -la ${{ github.workspace }}/build/ios/

      - name: path test2
        run: ls -la ${{ github.workspace }}/build/ios/archive

      - name: path test3
        run: ls -la ${{ github.workspace }}/build/ios/ipa
      
      # - name: 🍏🚀 Deploy to App Store (Testflight)
      #   uses: apple-actions/upload-testflight-build@v1
      #   with:
      #     app-path: ${{ github.workspace }}/build/ios/archive/gongsacok.ipa
      #     issuer-id: ${{ secrets.APP_STORE_CONNECT_ISSUER_ID }}
      #     api-key-id: ${{ secrets.APP_STORE_CONNECT_API_KEY_ID }}
      #     api-private-key: $APP_STORE_PRIVATE_KEY_PATH

error:

flutter build ipa \
    --release \
    --flavor dev \
    --export-options-plist=ios/Runner/ExportOptions.plist
  shell: /bin/bash -e {0}
  env:
    JAVA_HOME: /Users/runner/hostedtoolcache/Java_Adopt_jdk/11.0.21-9/x64/Contents/Home
    FLUTTER_ROOT: /Users/runner/hostedtoolcache/flutter
    PUB_CACHE: /Users/runner/.pub-cache

💪 Building with sound null safety 💪

Archiving com.wazzang.gongsacok...
Automatically signing iOS for device deployment using specified development team in Xcode project: 9RQ5SK298N
Running pod install...                                            169.7s
Running Xcode build...                                          
Xcode archive done.                                         26.0s
Failed to build iOS app
Error output from Xcode build:
↳
    ** ARCHIVE FAILED **


Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/qv/pdh5wsgn0lq3dp77zj602b5c0000gn/T/flutter_tools.xAwwQO/flutter_ios_build_temp_dirOJdWvi/temporary_xcresult_bundle

    note: Building targets in dependency order
    /Users/runner/work/gongsacokapp/gongsacokapp/ios/Runner.xcodeproj: error: No profiles for 'com.wazzang.gongsacok.ImageNotification' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.wazzang.gongsacok.ImageNotification'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'ImageNotification' from project 'Runner')
    /Users/runner/work/gongsacokapp/gongsacokapp/ios/Runner.xcodeproj: error: No profiles for 'com.wazzang.gongsacok' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.wazzang.gongsacok'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild. (in target 'Runner' from project 'Runner')
    warning: Run script build phase 'Run Script' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
    warning: Run script build phase 'Thin Binary' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')
Error (Xcode): No profiles for 'com.wazzang.gongsacok.ImageNotification' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.wazzang.gongsacok.ImageNotification'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
/Users/runner/work/gongsacokapp/gongsacokapp/ios/Runner.xcodeproj

Error (Xcode): No profiles for 'com.wazzang.gongsacok' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.wazzang.gongsacok'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
/Users/runner/work/gongsacokapp/gongsacokapp/ios/Runner.xcodeproj


It appears that there was a problem signing your application prior to installation on the device.

Verify that the Bundle Identifier in your project is your signing id in Xcode
  open ios/Runner.xcworkspace

Also try selecting 'Product > Build' to fix the problem.
Encountered error while archiving for device.
    warning: Run script build phase '[firebase_crashlytics] Crashlytics Upload Symbols' will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking "Based on dependency analysis" in the script phase. (in target 'Runner' from project 'Runner')

    Result bundle written to path:
        /var/folders/qv/pdh5wsgn0lq3dp77zj602b5c0000gn/T/flutter_tools.xAwwQO/flutter_ios_build_temp_dirOJdWvi/temporary_xcresult_bundle


Error: Process completed with exit code 1.

exportOptions.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>destination</key>
    <string>export</string>
    <key>manageAppVersionAndBuildNumber</key>
    <false/>
    <key>method</key>
    <string>app-store</string>
    <key>provisioningProfiles</key>
    <dict>
        <key>com.wazzang.gongsacok</key>
        <string>ios_dist_pp</string>
        <key>com.wazzang.gongsacok.ImageNotification</key>
        <string>ios_dist_noti_pp</string>
    </dict>
    <key>signingCertificate</key>
    <string>Apple Distribution</string>
    <key>signingStyle</key>
    <string>manual</string>
    <key>stripSwiftSymbols</key>
    <true/>
    <key>teamID</key>
    <string>9RQ5SK298N</string>
    <key>uploadSymbols</key>
    <true/>
</dict>
</plist>

I have checked that the filenames of the profiles match those in the YAML file and verified that the profiles are linked to the correct certificate. I also confirmed that the linked certificate is intended for iOS distribution purposes.

Latest articles

spot_imgspot_img

Related articles

Leave a reply

Please enter your comment!
Please enter your name here

spot_imgspot_img