flutter_flatpak_example icon indicating copy to clipboard operation
flutter_flatpak_example copied to clipboard

aarch64

Open niccokunzmann opened this issue 1 year ago • 7 comments

When I look at the code, I wonder how to build an arm build of the flutter app.

https://github.com/Merrit/flutter_flatpak_example/blob/b47432e2748c2b497370042340c026dfef4404c5/counter_app/build-flutter-app.sh#L26

This example seems to be only x64. Do I read that right? The flatpack action allows building for both platforms. I will have a look on how to achieve this.

It seems easy to me:

  • build both architectures
  • create an archive for both architectures
  • submit a build for these

Something I need to figure out: Is there a way in the manifest to download a different archive depending on the build architecture?

See also:

  • https://github.com/flathub/flathub/pull/5085

niccokunzmann avatar Mar 26 '24 17:03 niccokunzmann

The example is only for x64, yes. I haven't ever built for aarch64 so I don't have experience there.

Is there a way in the manifest to download a different archive depending on the build architecture?

I don't know about that, you'd be best to ask the Flatpak/FlatHub folks there.

Also, aarch64 builds are "nice to have" in that they are supported already so "why not?", but having it is not a requirement for submission to FlatHub - the reviewer was just asking if it could be added.

Building from source is problematic for Flutter because it requires network access to get dependencies during the build phase, and the Flatpak build environment forbids network access. There is a related Flutter issue tracking that.

Merrit avatar Mar 26 '24 18:03 Merrit

flatpak is support arm, but flutter maybe not support arm, flutter linux release

jcleng avatar Apr 05 '24 05:04 jcleng

Yes, there seems not to be an official release. However, looking at the web, people build the flutter sdk on the Raspberry Pi themselves and then use that to compile and it seems to work.

niccokunzmann avatar Apr 05 '24 18:04 niccokunzmann

ye it has

uname -a
Linux localhost 6.1.77-0-virt #1-Alpine SMP Wed, 07 Feb 2024 18:04:21 +0000 aarch64 Linux

apk search flutter
flutter-3.19.4-r0
flutter-common-3.19.4-r0
flutter-desktop-3.19.4-r0
flutter-developer-3.19.4-r0
flutter-glfw-3.19.4-r0
flutter-gtk-3.19.4-r0
flutter-tool-3.19.4-r0
flutter-tool-developer-3.19.4-r0

jcleng avatar Apr 09 '24 08:04 jcleng

@jcleng Flutter supports Linux arm64, but it needs to be built from source code. You can also use third-party built packages https://github.com/containerbase/flutter-prebuild/releases

kjxbyz avatar Jun 23 '24 12:06 kjxbyz