Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rosetta support to Flutter installation script for Apple Silicon chip #45

Open
KevinJ1008 opened this issue May 6, 2024 · 0 comments
Open

Comments

@KevinJ1008
Copy link
Contributor

Describe Request:

Flutter installation script is fine, it will download related flutter version to every arch, but maybe we could handle Rosetta as well? Or flutter build ios will fail due to Flutter needs Rosetta translation on ARM Macs. (I know circleci/macos orb could help us install Rosetta, but just wondering do we have any chance to handle it in this orb or not.)

Doctor summary (to see all details, run flutter doctor -v):
[!] Flutter (Channel stable, 3.16.2, on macOS 14.3.1 23D60 darwin-arm64, locale en-US)
    ✗ Downloaded executables cannot execute on host.
      See https://github.com/flutter/flutter/issues/6207 for more information.
      Flutter requires the Rosetta translation environment on ARM Macs. Try running:
        sudo softwareupdate --install-rosetta --agree-to-license

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3)
[✗] 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 (not installed)
[✓] Connected device (1 available)
[✓] Network resources

Examples:

Add script below in install-sdk.sh or add another command to handle it individually.

#!/usr/bin/env bash
function install_rosetta() {
  if [ "$(uname -m)" = "arm64" ]; then
      /usr/sbin/softwareupdate --install-rosetta --agree-to-license
  else
      echo "Rosetta 2 can only be installed on Apple Silicon!"
      exit 1
  fi
}

Supporting Documentation Links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant