Merrit / flutter_flatpak_example

An example of how to package a Flutter application as a Flatpak for distribution on Linux, using the default counter example app.
64 stars 8 forks source link

aarch64 #10

Open niccokunzmann opened 3 months ago

niccokunzmann commented 3 months ago

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:

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:

Merrit commented 3 months ago

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.

jcleng commented 2 months ago

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

niccokunzmann commented 2 months ago

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.

jcleng commented 2 months ago

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
kjxbyz commented 1 week ago

@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