subosito / flutter-action

Flutter environment for use in GitHub Actions. It works on Linux, Windows, and macOS.
MIT License
2.28k stars 202 forks source link

How to install flutter 2 on an Apple Silicon runner images? #297

Closed guilhermearaujo closed 7 months ago

guilhermearaujo commented 7 months ago

I have this project that still runs flutter 2.10.5, but I cannot get the action to install this version on the new runner images that run on Apple Silicon (macos-14 which is rolling out as macos-latest)

When the action run, it fails with:

Unable to determine Flutter version for channel: stable version: 2.10.5 architecture: arm64

How can I force the action to run with Rosetta 2?

bartekpacia commented 7 months ago

AFAIK, Flutter version before 3.0 didn't run natively on arm64. They were running on Rosetta.

(source 1) (source 2)

guilhermearaujo commented 7 months ago

Exactly, but is it possible to use this action to download the amd64 and run it through Rosetta?

bartekpacia commented 7 months ago

Set architecture to amd64 instead of arm64:

- name: Set up Flutter
  uses: subosito/flutter-action@v2
  with:
    channel: stable
    version: 2.10.x
    architecture: amd64
bartekpacia commented 7 months ago

Please let me know if it helped so I can maybe close the issue.

guilhermearaujo commented 7 months ago

It worked! I just had to use x64 instead of amd64. Thanks!