У меня проблема с созданием проекта hello world flutter для платформы macos arm64 (apple m1 pro silicon):
$ flutter build macos
Running "flutter pub get" in flutter_application_1... 234ms
💪 Building with sound null safety 💪
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006000-000C09201A06801E }
{ platform:macOS, arch:x86_64, id:00006000-000C09201A06801E }
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 no-dedup_instructions no-asserts use_field_guards use_osr no-branch_coverage x64-sysv no-compressed-pointers no-null-safety' but the VM has 'release no-code_comments no-dwarf_stack_traces_mode lazy_async_stacks lazy_dispatchers no-dedup_instructions no-asserts use_field_guards use_osr no-branch_coverage arm64-sysv no-compressed-pointers no-null-safety'
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
Building macOS application...
Build process failed
К сожалению, я не эксперт по флаттеру и инструментам сборки флаттера, но кажется, что флаттер создает двоичный файл x86_64 и по какой-то причине пытается запустить его на платформе aarch64. Как я могу сделать флаттер для сборки версии приложения aarch64?
Шаблонный проект, созданный с помощью команды:
flutter create --template app --platforms macos hello_world
Информация о версии инструментов:
$ flutter --version
Flutter 3.0.4 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 85684f9300 (3 months ago) • 2022-06-30 13:22:47 -0700
Engine • revision 6ba2af10bb
Tools • Dart 2.17.5 • DevTools 2.12.2
$ sw_vers
ProductName: macOS
ProductVersion: 12.1
BuildVersion: 21C52
$ xcodebuild -version
Xcode 13.0
Build version 13A233





Основная проблема заключалась в том, как я установил флаттер: nixpkgs. Он пытается найти инструменты в неправильной папке. После модификации патчей https://github.com/NixOS/nixpkgs/pull/196133 для macos все работает нормально.