8

Hi I am currently using this GitHub Action for CI/CD for my flutter project

Which runs-on: macOS-latest which I assume will be apple silicon. When it runs the flutter pub get in build_ios: I get this error.

/Users/runner/hostedtoolcache/flutter/2.13.0-0.1.pre-dev/x64/bin/internal/shared.sh: line 225: 
/Users/runner/hostedtoolcache/flutter/2.13.0-0.1.pre-dev/x64/bin/cache/dart-sdk/bin/dart: Bad CPU type in executable

Now I think the problem may be to do with not having rosseta stone installed on the GitHub action?

Any thoughts on how to install rosseta stone, or if this is a different error?

GILO
  • 2,444
  • 21
  • 47

5 Answers5

5

Make sure you specify architecture: arm64

- uses: subosito/flutter-action@v1
  with:
    flutter-version: '2.10.4'
    architecture: arm64
GILO
  • 2,444
  • 21
  • 47
4

The accepted answer unfortunately did not work for me.

The fix for myself was the following:

- uses: subosito/flutter-action@v2
    with:
      channel: 'stable'
      architecture: x64

Note that I upgraded the version of subsito from v1 to v2 and specified an architecture of x64.

James Mallon
  • 1,107
  • 9
  • 25
4

For me, the fix was to use the version 2 of subosito/flutter-action@v1 instead of 1:

- uses: subosito/flutter-action@v2 # instead of @v1
Valentin Vignal
  • 6,151
  • 2
  • 33
  • 73
3

This is my solution on a Flutter Project (Tested on Flutter 3.0.1 and Flutter 3.0.2).

My GitHub CI/Pipeline ci.yaml

- uses: actions/setup-java@v1
  with:
    java-version: "12.x"

- uses: subosito/flutter-action@v2
  with:
    channel: "stable"
    flutter-version: "3.0.2"
    architecture: x64

- name: flutter doctor
  run: |
    flutter doctor -v

Important as James mentioned: version of subsito needs to be v2 and specified an architecture of x64.

MKLarsen
  • 51
  • 5
0

I am facing the same problem, upgrade the flutter-action from v1.5.1 to v2 fixed this problem, there is no need to specify the architecture:

- uses: subosito/flutter-action@v1.5.1
  with:
      flutter-version: '3.0.5'
      channel: 'stable'
Dolphin
  • 29,069
  • 61
  • 260
  • 539