Answers: <p>I needed to change the distribution type. Thanks!</p>
  
Answers: CC BY-SA 4.0
Answers: 2021-02-06T01:26:21.360Z
Answers: 2021-02-06T01:26:21.360Z
Answers: beansbeans
Body: <h2>I <a href="https://medium.com/kinandcartacreated/setup-a-flutter-ci-cd-with-gitlab-ci-part-1-8d40b7a3b3dc" rel="nofollow noreferrer">followed</a> a guide</h2>
  <p>to setup a simple GitLab runner on my 2020 mac Mini with an M1 processor. <strong>Everything builds great except for iOS.</strong></p>
  <h1>My error:</h1>
  <pre><code>Xcode build done.                                           33.0s
  Built /Users/directories/build/ios/iphoneos/Runner.app.
  $ cd ios
  $ xcodebuild clean archive -workspace Runner.xcworkspace -scheme Runner -archivePath RunnerArchive
  Command line invocation:
      /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild clean archive -workspace Runner.xcworkspace -scheme Runner -archivePath RunnerArchive
  User defaults from command line:
      IDEArchivePathOverride = /Users/directories/ios/RunnerArchive
  note: Using new build system
  note: Building targets in parallel
  ** CLEAN SUCCEEDED **
  note: Using new build system
  note: Building targets in parallel
  note: Planning build
  note: Constructing build description
  error: Provisioning profile &quot;iOS Team Provisioning Profile: com.company.app&quot; doesn't include the currently selected device &quot;my Mac mini&quot; (identifier 11111111-111-1111-1111-11111111). (in target 'Runner' from project 'Runner')
  ** ARCHIVE FAILED **
  Cleaning up file based variables
  00:00
  ERROR: Job failed: exit status 1
  </code></pre>
  <p>If I use <code>flutter build ios</code> <em>from the command line, and even distribute with Xcode's GUI (no modifications), <strong>everything works fine</strong>.</em></p>
  <p>I noticed this <a href="https://developer.apple.com/forums/thread/668952" rel="nofollow noreferrer">post</a> about changing the xcodebuild destination, but I'm not sure how to approach this with flutter.</p>
  <h1>Here's my gitlab-ci.yml.</h1>
  <pre><code>stages:
  ##  - test # All jobs related for testing such as Unit Test
  #  - builda
    - buildi
  
  #flutter_test: # Name of the lane
  #  stage: test # type of stage
  #  script:
  #    - flutter test # Run Flutter test
  #  tags:
  #    - flutter # Tags for runner
  
  
  #flutter_build_android: #Job name
  #  stage: builda # kind of job
  #  before_script:
  #    - flutter packages get
  #    - flutter clean
  #  script:
  #     - flutter build apk
  #  artifacts:
  #    paths:
  #      - build/app/outputs/apk/release/app-release.apk
  #  tags:
  #    - flutter
  
  flutter_build_ios:
    stage: buildi
    before_script:
      - flutter packages get
      - flutter clean
    script:
      - flutter build ios
      - cd ios
      - xcodebuild clean archive -workspace Runner.xcworkspace -scheme Runner -archivePath RunnerArchive
      - xcodebuild -exportArchive -archivePath RunnerArchive.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath ./build
    artifacts:
      paths:
        - ios/build/Runner.ipa
    tags:
      - flutter
    
  </code></pre>
  <h1>flutter doctor. jic:</h1>
  <pre><code>[✓] Flutter (Channel master, 1.26.0-18.0.pre.211, on macOS 11.2 20D64 darwin-arm, locale en-US)
      • Flutter version 1.26.0-18.0.pre.211 at /Users/User/Dev/flutter
      • Framework revision 643e65984a (7 hours ago), 2021-02-05 08:58:31 -0800
      • Engine revision b04955656c
      • Dart version 2.13.0 (build 2.13.0-0.0.dev)
  
  [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
      • Android SDK at /Users/User/Library/Android/sdk
      • Platform android-30, build-tools 30.0.3
      • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
      • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
      • All Android licenses accepted.
  
  [✓] Xcode - develop for iOS and macOS
      • Xcode at /Applications/Xcode.app/Contents/Developer
      • Xcode 12.4, Build version 12D4e
      • CocoaPods version 1.10.1
  
  [✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
      ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
  
  [✓] Android Studio (version 4.1)
      • Android Studio at /Applications/Android Studio.app/Contents
      • Flutter plugin can be installed from:
         https://plugins.jetbrains.com/plugin/9212-flutter
      • Dart plugin can be installed from:
         https://plugins.jetbrains.com/plugin/6351-dart
      • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
  
  [✓] VS Code (version 1.53.0)
      • VS Code at /Applications/Visual Studio Code.app/Contents
      • Flutter extension version 3.19.0
  </code></pre>
  <p>It seems to be acting as though I'm trying to run the app on my Mac? Is that correct? <em>Why should it care?</em></p>
  <p><strong>I'm not sure one issue starts an another begins here</strong>. I understand if I have posted in the wrong place. Thanks to anyone with anything to offer.</p>
  
Tags: <gitlab><gitlab-ci-runner><macos><ios>
Title: GitLab CI/CD and building on Mac Mini with M1 Processor - Provision Profile
UserDisplayName: beansbeans
ThreadText: # GitLab CI/CD and building on Mac Mini with M1 Processor - Provision Profile
  
  (Asked by: username_0 on 2021-02-06)
  
  ## I [followed](https://medium.com/kinandcartacreated/setup-a-flutter-ci-cd-with-gitlab-ci-part-1-8d40b7a3b3dc) a guide
  
  to setup a simple GitLab runner on my 2020 mac Mini with an M1 processor. **Everything builds great except for iOS.**
  
  # My error:
  
  ```
  Xcode build done.                                           33.0s
  Built /Users/directories/build/ios/iphoneos/Runner.app.
  $ cd ios
  $ xcodebuild clean archive -workspace Runner.xcworkspace -scheme Runner -archivePath RunnerArchive
  Command line invocation:
      /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild clean archive -workspace Runner.xcworkspace -scheme Runner -archivePath RunnerArchive
  User defaults from command line:
      IDEArchivePathOverride = /Users/directories/ios/RunnerArchive
  note: Using new build system
  note: Building targets in parallel
  ** CLEAN SUCCEEDED **
  note: Using new build system
  note: Building targets in parallel
  note: Planning build
  note: Constructing build description
  error: Provisioning profile "iOS Team Provisioning Profile: com.company.app" doesn't include the currently selected device "my Mac mini" (identifier 11111111-111-1111-1111-11111111). (in target 'Runner' from project 'Runner')
  ** ARCHIVE FAILED **
  Cleaning up file based variables
  00:00
  ERROR: Job failed: exit status 1
  
  ```
  
  If I use `flutter build ios` *from the command line, and even distribute with Xcode's GUI (no modifications), **everything works fine**.*
  
  I noticed this [post](https://developer.apple.com/forums/thread/668952) about changing the xcodebuild destination, but I'm not sure how to approach this with flutter.
  
  # Here's my gitlab-ci.yml.
  
  ```
  stages:
  ##  - test # All jobs related for testing such as Unit Test
  #  - builda
    - buildi
  
  #flutter_test: # Name of the lane
  #  stage: test # type of stage
  #  script:
  #    - flutter test # Run Flutter test
  #  tags:
  #    - flutter # Tags for runner
  
  #flutter_build_android: #Job name
  #  stage: builda # kind of job
  #  before_script:
  #    - flutter packages get
  #    - flutter clean
  #  script:
  #     - flutter build apk
  #  artifacts:
  #    paths:
  #      - build/app/outputs/apk/release/app-release.apk
  #  tags:
  #    - flutter
  
  flutter_build_ios:
    stage: buildi
    before_script:
      - flutter packages get
      - flutter clean
    script:
      - flutter build ios
      - cd ios
      - xcodebuild clean archive -workspace Runner.xcworkspace -scheme Runner -archivePath RunnerArchive
      - xcodebuild -exportArchive -archivePath RunnerArchive.xcarchive -exportOptionsPlist ExportOptions.plist -exportPath ./build
    artifacts:
      paths:
        - ios/build/Runner.ipa
    tags:
      - flutter
    
  
  ```
  
  # flutter doctor. jic:
  
  ```
  [✓] Flutter (Channel master, 1.26.0-18.0.pre.211, on macOS 11.2 20D64 darwin-arm, locale en-US)
      • Flutter version 1.26.0-18.0.pre.211 at /Users/User/Dev/flutter
      • Framework revision 643e65984a (7 hours ago), 2021-02-05 08:58:31 -0800
      • Engine revision b04955656c
      • Dart version 2.13.0 (build 2.13.0-0.0.dev)
  
  [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
      • Android SDK at /Users/User/Library/Android/sdk
      • Platform android-30, build-tools 30.0.3
      • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
      • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
      • All Android licenses accepted.
  
  [✓] Xcode - develop for iOS and macOS
      • Xcode at /Applications/Xcode.app/Contents/Developer
      • Xcode 12.4, Build version 12D4e
      • CocoaPods version 1.10.1
  
  [✗] Chrome - develop for the web (Cannot find Chrome executable at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome)
      ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
  
  [✓] Android Studio (version 4.1)
      • Android Studio at /Applications/Android Studio.app/Contents
      • Flutter plugin can be installed from:
         https://plugins.jetbrains.com/plugin/9212-flutter
      • Dart plugin can be installed from:
         https://plugins.jetbrains.com/plugin/6351-dart
      • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
  
  [✓] VS Code (version 1.53.0)
      • VS Code at /Applications/Visual Studio Code.app/Contents
      • Flutter extension version 3.19.0
  
  ```
  
  It seems to be acting as though I'm trying to run the app on my Mac? Is that correct? *Why should it care?*
  
  **I'm not sure one issue starts an another begins here**. I understand if I have posted in the wrong place. Thanks to anyone with anything to offer.
  
  **Tags:** gitlab, gitlab-ci-runner, macos, ios
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-02-06. Score: 1
  
  I needed to change the distribution type. Thanks!
  
  
  ---
  
  