Closed Keetz closed 7 months ago
show me flutter doctor --verbose
result. There are something wrong in your environment
#include <native_window.h>
results in errors. So your environment can't build android native apps. I don't know the reason.My suggestion is DON'T use flutter from snap, snap has it's own build environment which may conflict with android ndk's.
Everything works fine without the plugin, I can run it on my Android phone or an Android emulator without any issues. The NDK, SDK, cmake and whatever is all installed through the SDK Manager in Android Studio, and again, it works fine until I add the fvp plugin.
username@username-desktop:~/Documents/test$ flutter doctor --verbose
[✓] Flutter (Channel stable, 3.19.5, on Ubuntu 22.04.4 LTS 6.5.0-28-generic, locale en_US.UTF-8)
• Flutter version 3.19.5 on channel stable at /home/username/snap/flutter/common/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 300451adae (4 weeks ago), 2024-03-27 21:54:07 -0500
• Engine revision e76c956498
• Dart version 3.3.3
• DevTools version 2.31.1
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /home/username/Android/Sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /home/username/android-studio/jbr/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
• All Android licenses accepted.
[✓] Chrome - develop for the web
• Chrome at google-chrome
[✓] Linux toolchain - develop for Linux desktop
• clang version 10.0.0-4ubuntu1
• cmake version 3.16.3
• ninja version 1.10.0
• pkg-config version 0.29.1
[✓] Android Studio (version 2022.2)
• Android Studio at /home/username/android-studio
• Flutter plugin version 76.3.1
• Dart plugin version 222.4582
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
[✓] VS Code (version 1.88.1)
• VS Code at /snap/code/current/usr/share/code
• Flutter extension version 3.86.0
[✓] Connected device (3 available)
• Pixel 7 (mobile) • 29021FDH200D4B • android-arm64 • Android 14 (API 34)
• Linux (desktop) • linux • linux-x64 • Ubuntu 22.04.4 LTS 6.5.0-28-generic
• Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.60
[✓] Network resources
• All expected network resources are available.
• No issues found!
your environment can't build a simplest c++ file. You can build other flutter projects because no c++ code in those projects. Nothing wrong in my code. DO NOT use snap because it's c++ environment may conflicts with host and flutter environment. I can build without error without snap https://github.com/wang-bin/mdk-examples/actions/runs/8787920383/job/24144012772
Okay, thanks. I will try and remove the snap and download Flutter manually instead.
@wang-bin thanks again, I can confirm that removing everything related to the Flutter snap and manually downloading Flutter instead works.
Describe the bug Ran
flutter create
to create the counter app. Added the fvp plugin in the yamlfvp: ^0.17.0
. And now I can't run it on android.Expected behavior I expect it to work without any further alterations.
Log