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

flutter build bundle doesn't work in raspberry pi 4 #42

Closed
danialhedaiat opened this issue Mar 10, 2020 · 1 comment
Closed

flutter build bundle doesn't work in raspberry pi 4 #42

danialhedaiat opened this issue Mar 10, 2020 · 1 comment

Comments

@danialhedaiat
Copy link

danialhedaiat commented Mar 10, 2020

I try to make flutter asset form a new project that I create now, and edit lib/main.dart void main() to what you say after that I try to do flutter build bundle but it raises this error

Snapshot not compatible with the current VM configuration: the snapshot requires
'release use_bare_instructions no-"asserts" "use_field_guards" "use_osr"
causal_async_stacks no-code-comments x64-sysv' but the VM has 'release
use_bare_instructions no-"asserts" "use_field_guards" "use_osr"
causal_async_stacks no-code-comments arm-eabi hardfp'

Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
Failed to build bundle.

I search about that and I get this error to come when dart version it not for flutter is it right?

I use flutter

Flutter 1.12.13+hotfix.8 • channel stable •
https://github.com/flutter/flutter.git
Framework • revision 0b8abb4724 (4 weeks ago) • 2020-02-11 11:44:36 -0800
Engine • revision e1e6ced81d
Tools • Dart 2.7.1

@danialhedaiat danialhedaiat changed the title i have promblem with install flutter and dart on raspberry pi 4 flutter build bundle doesn't work Mar 10, 2020
@danialhedaiat danialhedaiat changed the title flutter build bundle doesn't work flutter build bundle doesn't work in raspberry pi 4 Mar 11, 2020
@ardera
Copy link
Owner

ardera commented Mar 12, 2020

I think the flutter SDK isn't yet ready to be used on ARM / AARCH64, so it probably won't work on the Pi 4. Maybe you can get it to work with a lot of hacks, but I don't know how.

To be more precise, this is the exact error:

[...] the snapshot requires
'[...] x64-sysv' but the VM has '[...] arm-eabi hardfp'

The flutter SDK uses dart internally for a lot of it's tools. So when you run flutter build bundle, the flutter script will launch some dart snapshot internally that completes the task of building the asset bundle. Dart snapshots are basically dart code compiled to machine code, so a dart snapshot generated for x86-64 cannot be run on ARM 32bit hardfp, but that's exactly what the flutter script tries to do in your case.

Maybe it's somehow possible to regenerate the snapshots for arm-eabi hardfp, or to avoid using snapshots at all (dart can interpret and JIT-compile too) but I don't know how to do that. You should consider opening an issue at the official flutter repo or maybe someone on the flutter discord can help you. Even then, if you fix this issue, you may run into other incompatibilities.

Also, I really recommend building the asset bundle on a machine more powerful than the Pi 4. The build takes ~10 seconds on my desktop, I'm sure it'll take a lot longer on the Pi 4.

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

2 participants