gpt4 book ai didi

flutter - 如何替换 Flutter 中捆绑的 Dart SDK 以在 Apple Silicon (ARM64) 上本地运行?

转载 作者:行者123 更新时间:2023-12-04 11:53:34 33 4
gpt4 key购买 nike

Dart SDK 正式支持 ARM64,截至目前, 2.14.2 是支持 ARM64 的最新(稳定)Dart SDK。尽管它与我的 Flutter 设置中捆绑的版本相同,但它似乎在 Intel 架构上运行(事件监视器显示在 Intel 上运行的 dart 进程)。
我手动尝试在我的 flutter 安装上替换 dart SDK bu 替换 flutter-directory/bin/cache/dart-sdk/带有为 ARM64 制作的 Dart SDK 的 zip 文件的内容,从 dart.dev archive 下载.但是尝试在 Android 模拟器(它在 ARM64 上运行并且正在处理我的旧 Flutter 设置)上运行应用程序时,会引发此错误:

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.

有没有其他方法可以在 M1 设备上进行完全 ARM64 Flutter 设置?
flutter 版本 2.5.1
Dart 版本 2.14.2
设备:MacBook Air(M1,2020)

最佳答案

似乎还不能与 Flutter 一起使用,如下所示:

Apple Silicon support in the Dart SDK

[...] Note that the Dart SDKbundled in the Flutter SDK doesn’t have these improvements yet.


https://medium.com/dartlang/announcing-dart-2-14-b48b9bb2fb67
[宣布 Dart 2.14][屏幕截图]: /image/N8Qcc.png
和:

Get the Dart SDK

[...]As of Flutter 1.21, the Flutter SDK includes the full Dart SDK. So if you have Flutter installed, you might not need to explicitly download the Dart SDK. Considerdownloading the Dart SDK if any of the following are true:

  • You don’t use Flutter.
  • You use a pre-1.21 version of Flutter.
  • You wantto reduce disk space requirements or download time, and your use casedoesn’t require Flutter. For example, you might have a continuousintegration (CI) setup that requires Dart but not Flutter.

https://dart.dev/get-dart
【获取Dart SDK】【截图】: /image/rawJV.png

关于flutter - 如何替换 Flutter 中捆绑的 Dart SDK 以在 Apple Silicon (ARM64) 上本地运行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69274086/

33 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com