I need to build a flutter app to run it from a raspberry pi 4

Viewed 23

I have installed flutter on my pc with ubuntu 18.04, I have built the classic counter flutter application that comes as a sample.

If I run on my pc flutter run it works fine.

Then I run flutter build linux

I copy from the project folder <poject_folder>/build/linux/x64/release/bundle/ for the raspberry pi and when I run from there "flutter-pi --release flutter_application_1" then it throws this error:

[flutter-pi] Could not find "app.so" file inside "/home/pi/flutter_bundle_test/flutter_application_1", which is required for release and profile mode.

Update:

I don't want to build the app through snap, I wanted to be able to build it locally to test it on the raspberry pi and once it's done then publish it to snap.

I have also looked at https://github.com/ardera/flutter-pi#building-the-appso-for-running-your-app-in-releaseprofile-mode.

I am stopped at step 7: Build the app.so. If you're building for arm64, you need to omit the --sim-use-hardfp flag.

In step 5 there is the link to the Engine Binaries repo but as I see it is to install on the raspberry pi.

When I try to run this:

gen_snapshot_linux_x64_release \
   --deterministic \
   --snapshot_kind=app-aot-elf \
   --elf=build/flutter_assets/app.so \
   --strip \
   --sim-use-hardfp \
   build/kernel_snapshot.dill

it tells me "gen_snapshot_linux_x64_release: command not found"

1 Answers
Related