Dart VM初始化失败:快照不兼容

时间:2019-07-19 23:18:42

标签: dart

我只是运行dart2aot main.dart main.aot将dart文件编译为二进制文件,并且在Windows上运行良好,但是当我尝试在另一台计算机上使用Linux OS(Ubuntu)进行dartaotruntime main.aot时,则无法正常工作,给我那个错误:

VM initialization failed: Snapshot not compatible with the current VM configuration: the snapshot requires 'product use_bare_instructions no-"asserts" no-causal_async_stacks no-bytecode x64-win' but the VM has 'product use_bare_instructions no-"asserts" no-causal_async_stacks no-bytecode x64-sysv

我该如何解决?在Windows机器上有一种方法可以为Linux生成aot吗?

1 个答案:

答案 0 :(得分:0)

Vyacheslav Egorov对Dart SDK团队的回答:

我们目前不支持使用Dart SDK交叉编译AOT快照。要为Linux生成快照,您需要运行Linux版本的Dart SDK。 (例如,您可以尝试使用https://docs.microsoft.com/en-us/windows/wsl/install-win10