flutter / flutter

Flutter makes it easy and fast to build beautiful apps for mobile and beyond
https://flutter.dev
BSD 3-Clause "New" or "Revised" License
162.25k stars 26.66k forks source link

Flutter on ARM64 chromebook #146949

Closed mictadlo closed 4 weeks ago

mictadlo commented 1 month ago

Steps to reproduce

I found a post here from @christopherfujino that:

Linux Host ARM64 is supported for linux ARM64 and web targets on the latest master channel.

Unfortunately, I do not know how to get it installed. Could you please provide me with any installation steps?

Thank you in advance,

Michal

Actual results

I can't find ARM64 from Flutter SDK

Logs

No response

Flutter Doctor output

I was not able to find Flutter for ARM64

bc-lee commented 1 month ago

I believe you're talking about the Linux Arm64 Host.

From what I understand, the Flutter SDK can be built from source on Linux Arm64, but the Flutter team doesn't provide pre-built binaries for it. Flutter requires several native binaries/libs to run.

However, you can try building the Flutter SDK from source on your Linux Arm64 machine, or you can use others' pre-built binaries like https://github.com/containerbase/flutter-prebuild, but use it at your own risk.

mictadlo commented 4 weeks ago

Hi, Thank you. My Lenove Duet Chromebook might not handle a second layer of virtualization. Is there a reason why Google/Dart/Flutter does not provide ARM64 releases? I think people with ARM64 Chromebooks and Raspberry PI would like it, too.

darshankawar commented 4 weeks ago

@mictadlo Most probably this is similar to the one you are looking for. You will need to follow-up in it for further updates or share your findings in it for better tracking. Closing this in favor of the linked issue. If you disagree, write in comments and I'll reopen it.

christopherfujino commented 4 weeks ago

@mictadlo Most probably this is similar to the one you are looking for. You will need to follow-up in it for further updates or share your findings in it for better tracking. Closing this in favor of the linked issue. If you disagree, write in comments and I'll reopen it.

Thanks for linking that issue @darshankawar. I just closed that issue, as we actually do build and upload binaries for linux arm64 hosts, you just can't download a tarball for it from the website. However, if you clone this repository on a linux arm64 machine, the flutter/bin/flutter bash script should ensure that you have all the correct architecture binaries downloaded.

I have done this before on a raspberry pi. I have not kept up to date with linux userspace on ChromeOS, so your mileage may vary there (if you have a mainstream Linux distribution installed such as Ubuntu or Arch, things should "just work").

mictadlo commented 4 weeks ago

Thank you, it works. Any suggestions how to improve it?

Dependencies for Web apps

$ sudo apt-get install chromium

Dependencies for Linux apps

$ sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev

VS Code Source: https://wiki.debian.org/VisualStudioCode

$ curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
$ sudo install -o root -g root -m 644 microsoft.gpg /usr/share/keyrings/microsoft-archive-keyring.gpg

$ sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'

$ sudo apt-get update
$ sudo apt-get install code

Flutter SDK

$ mkdir projects
$ cd projects/

$ git clone https://github.com/flutter/flutter.git

$ cd flutter/bin/
$ ./flutter 
Building flutter tool...
Resolving dependencies... (6.7s)
Downloading packages... (36.5s)
Got dependencies.

$ export PATH="$PATH:/home/mtlorenc/projects/flutter/bin"
$ export CHROME_EXECUTABLE="/usr/bin/chromium"

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 3.22.0-14.0.pre.29, on Debian GNU/Linux 12 (bookworm) 6.6.17-01102-gd3cec3c11146, locale en_US.UTF-8)
[✗] 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/linux#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.

[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[!] Android Studio (not installed)
[✓] VS Code (version 1.82.0)
[✓] Connected device (2 available)
christopherfujino commented 4 weeks ago

Thank you, it works. Any suggestions how to improve it?

This is more or less what I would do (although with vim :) ). One option is to use canonical's Flutter snap: https://snapcraft.io/flutter, which I believe would handle sudo apt-get install clang cmake ninja-build pkg-config libgtk-3-dev, although you'd also have to install and/or configure snap.

github-actions[bot] commented 2 weeks ago

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.