subosito / flutter-action

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

Arm64 machine not supported. #161

Closed wangmir closed 2 years ago

wangmir commented 2 years ago

Since flutter 3.0.0 supports apple silicon native support, I tried to change the architecture of action to arm64 for macos build.

but it failed with this message,

/Users/runner/hostedtoolcache/flutter/bin/internal/shared.sh: line 225: /Users/runner/hostedtoolcache/flutter/bin/cache/dart-sdk/bin/dart: Bad CPU type in executable
wangmir commented 2 years ago

When I tried to change cache key and path, it still failed..

Run flutter pub get
  flutter pub get
  shell: /bin/bash -e {0}
  env:
    FLUTTER_ROOT: /Users/runner/hostedtoolcache/flutter_arm
    PUB_CACHE: /Users/runner/hostedtoolcache/flutter_arm/.pub-cache
/Users/runner/hostedtoolcache/flutter_arm/bin/internal/shared.sh: line [2](https://github.com/ming-app/ming/runs/6439098507?check_suite_focus=true#step:4:2)2[5](https://github.com/ming-app/ming/runs/6439098507?check_suite_focus=true#step:4:5): /Users/runner/hostedtoolcache/flutter_arm/bin/cache/dart-sdk/bin/dart: Bad CPU type in executable
Error: Process completed with exit code 1.
yurikoles commented 2 years ago

Is this a self-hosted runner with arm64 CPU?

Jesperpaulsen commented 2 years ago

I'm experiencing the same problem on Github Actions now

Just realized I was using version 1. After upgrading to version 2 it is working.

kuhnroyal commented 2 years ago

You have to use the action 2.4.0 and if you have enabled the cache, you need to make sure that the key contains the architecture. On a self-hosted runner disable caching, clear the /Users/runner/hostedtoolcache/flutter folder and try again with 2.4.0 - it works.

kuhnroyal commented 2 years ago

@subosito @wangmir I think this issue can be closed. I have used the action on Arm64 for 2 weeks now and there are no problems.

subosito commented 2 years ago

Thanks @kuhnroyal!