Debian 10 ARM64嵌入式设备Flutter-elinux Demo运行受阻求助
在Debian 10 ARM64嵌入式设备运行Flutter Demo的问题
设备及环境详情
$ lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 10 (buster) Release: 10 Codename: buster $ uname -a Linux linaro-alip 4.19.193 #2 SMP Tue Jul 5 10:08:34 UTC 2022 aarch64 GNU/Linux
问题现状
使用flutter-elinux create demo成功创建项目,但执行flutter-elinux run -d elinux或flutter-elinux build elinux --target-arch=arm64时,均卡在**"Downloading elinux-common tools..."**步骤。flutter-elinux doctor -v检测结果如下:
sample_elinux$ ls README.md analysis_options.yaml android elinux ios lib linux macos pubspec.lock pubspec.yaml sample_elinux.iml test web windows $ flutter-elinux doctor -v Flutter 3.10.5 • channel unknown • unknown source Framework • revision 796c8ef792 (4 weeks ago) • 2023-06-13 15:51:02 -0700 Engine • revision 45f6e00911 Tools • Dart 3.0.5 • DevTools 2.23.1 Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure you trust this source! [!] Flutter (Channel unknown, 3.10.5, on Debian GNU/Linux 10 (buster) 4.19.193, locale C.UTF-8) ! Flutter version 3.10.5 on channel unknown at /media/linaro/ef0e9ea8-873f-4819-bc21-6790e2ddc7b7/env/flutter-elinux/flutter Currently on an unknown channel. Run `flutter channel` to switch to an official channel. If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install. ! The flutter binary is not on your path. Consider adding /media/linaro/ef0e9ea8-873f-4819-bc21-6790e2ddc7b7/env/flutter-elinux/flutter/bin to your path. ! The dart binary is not on your path. Consider adding /media/linaro/ef0e9ea8-873f-4819-bc21-6790e2ddc7b7/env/flutter-elinux/flutter/bin to your path. ! Unknown upstream repository. Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install. • Framework revision 796c8ef792 (4 weeks ago), 2023-06-13 15:51:02 -0700 • Engine revision 45f6e00911 • Dart version 3.0.5 • DevTools version 2.23.1 • Pub download mirror https://pub.flutter-io.cn • Flutter download mirror https://storage.flutter-io.cn • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades. [✓] eLinux toolchain - develop for embedded Linux devices • clang version 7.0.1-8+deb10u2 (tags/RELEASE_701/final) • cmake version 3.13.4 • pkg-config version 0.29 [✗] Android toolchain - develop for Android devices ✗ Unable to locate Android SDK. Install Android Studio from: https://developer.android.com/studio/index.html On first launch it will assist you in installing the Android SDK components. (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions). If the Android SDK has been installed to a custom location, please use `flutter config --android-sdk` to update to that location. [✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome) ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable. [✓] Linux toolchain - develop for Linux desktop • clang version 7.0.1-8+deb10u2 (tags/RELEASE_701/final) • cmake version 3.13.4 • ninja version 1.8.2 • pkg-config version 0.29 [!] Android Studio (not installed) • Android Studio not found; download from https://developer.android.com/studio/index.html (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions). [✓] Connected device (3 available) • Linux (desktop) • linux • linux-arm64 • Debian GNU/Linux 10 (buster) 4.19.193 • eLinux (desktop) • elinux-wayland • flutter-tester • Debian GNU/Linux 10 (buster) 4.19.193 • eLinux (desktop) • elinux-x11 • flutter-tester • Debian GNU/Linux 10 (buster) 4.19.193
解决建议
修复环境PATH
将flutter-elinux的bin目录加入系统PATH,避免路径问题导致的下载异常:echo 'export PATH="/media/linaro/ef0e9ea8-873f-4819-bc21-6790e2ddc7b7/env/flutter-elinux/flutter/bin:$PATH"' >> ~/.bashrc source ~/.bashrc手动下载elinux-common工具
自动下载卡住通常是网络或源的问题,可手动获取对应版本的工具包:- 查看flutter-elinux的日志文件(一般在
~/.flutter-elinux/logs/)找到下载链接 - 下载后解压到
~/.flutter-elinux/elinux-common/目录下,确保目录结构与自动下载一致
- 查看flutter-elinux的日志文件(一般在
补充嵌入式依赖库
安装Debian 10 ARM64下运行Flutter eLinux所需的基础依赖:sudo apt-get update && sudo apt-get install -y libgtk-3-dev libglib2.0-dev libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev指定运行后端
尝试明确指定Wayland或X11后端运行,避免默认设备的兼容性问题:# 使用X11后端 flutter-elinux run -d elinux-x11 # 使用Wayland后端 flutter-elinux run -d elinux-wayland
内容的提问来源于stack exchange,提问作者zzy
相关产品推荐
相关产品推荐

