You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在树莓派运行cabin-demo时出现FlutterPi错误,求解决建议

问题

按照flutter-pi官方指南及相关视频操作,执行了以下步骤:

  • 手动安装树莓派专用Flutter二进制文件
  • 下载并构建cabin-demo应用
  • 在Linux机器上完成构建后,将应用复制到树莓派运行

运行应用时出现如下错误:

flutter: The Dart VM service is listening on http://127.0.0.1:46225/_o4DEwTeGs4=/
[ERROR:flutter/shell/common/shell.cc(91)] Dart Error: Can't load Kernel binary: Invalid kernel binary format version.
[ERROR:flutter/runtime/dart_isolate.cc(144)] Could not prepare isolate.
[ERROR:flutter/runtime/runtime_controller.cc(422)] Could not create root isolate.
[ERROR:flutter/shell/common/shell.cc(614)] Could not launch engine with configuration.
[compositor] Preferred framebuffer depth for hardware cursor is not supported by flutter-pi.
[compositor] Could not mmap dumb buffer for uploading the hardware cursor icon. mmap: Invalid argument

树莓派环境信息:

PRETTY_NAME="Raspbian GNU/Linux 11 (bullseye)"
NAME="Raspbian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian

请问操作步骤中遗漏了什么?恳请提供解决建议。

解决建议

核心问题:Kernel版本不兼容

Invalid kernel binary format version 是报错的根源,后续错误均由此引发——构建cabin-demo使用的Flutter SDK版本,与树莓派上安装的flutter-engine二进制文件版本不匹配。解决方法:

  1. 确认树莓派上flutter-engine的具体版本(可从下载的压缩包命名、配套README文件中获取)
  2. 在用于构建的Linux机器上,安装完全相同版本的Flutter SDK
  3. 重新构建cabin-demo,确保构建环境与树莓派的engine版本严格对齐

光标相关错误处理

针对Preferred framebuffer depth for hardware cursor is not supported错误,可通过禁用硬件光标解决:

  • 运行应用时添加参数:flutter-pi --disable-hardware-cursor <你的应用路径>
  • 或修改flutter-pi的配置文件,默认关闭硬件光标功能

额外检查项

  • 验证复制到树莓派的应用文件完整性,避免传输过程中出现文件损坏
  • 确认树莓派上的flutter-pi版本与安装的engine版本兼容,建议同步更新flutter-pi至对应版本

内容的提问来源于stack exchange,提问作者slawalata

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.15 23:02:23