Member-only story
Flutter — How to replace the bundled Dart SDK in Flutter to run natively on Apple Silicon (ARM64)
Dart SDK officially supports ARM64 and as of now, 2.14.2 is the latest (stable) Dart SDK that has support for ARM64
2 min readDec 15, 2021
Launching lib/main.dart on sdk gphone64 arm64 in debug mode...
lib/main.dart:1
Snapshot not compatible with the current VM configuration: the snapshot requires 'release no-code_comments
no-dwarf_stack_traces_mode lazy_async_stacks lazy_dispatchers
use_bare_instructions no-dedup_instructions
no-"asserts" "use_field_guards" "use_osr" x64-sysv no-null-safety' but the VM has 'release no-code_comments no-
dwarf_stack_traces_mode lazy_async_stacks
lazy_dispatchers use_bare_instructions no-dedup_instructions no-"asserts" "use_field_guards" "use_osr" arm64-sysv no-null-safety'
2
the Dart compiler exited unexpectedly.
How to fix
- Download dart sdk directly from dart.dev: https://dart.dev/get-dart/archive — once you extract it, you will see a
dart-sdk
folder - Go to your flutter installation root, and enter this path:
flutter-sdk-root/bin/cache
- Replace
dart-sdk
from the previous step with the one you've downloaded
Now, this part is hacky, so I can’t really guarantee it will always work.
If you try to run the app now, dart compiler will crash.