我在Ubuntu20.04 LTS.I上。我用sudo snap install flutter --classic安装了flutter SDK,然后我用sudo snap install andriod-studio --classic安装了android studio,但当我在终端上运行flutter doctor时,它输出如下:
[✓] Flutter (Channel stable, 2.0.3, on Linux, locale en_US.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
✗ Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/linux#android-setup for
more details.
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] Connected device (1 available)
! Doctor found issues in 2 categoriesN当我在VS代码中打开任何flutter项目,并在连接物理设备的终端中点击flutter run进行调试时,它说:
Launching lib/main.dart on DUB LX1 in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
Could not open settings generic class cache for settings file '/home/suraj/Projects/wordpair/android/settings.gradle' (/home/suraj/.gradle/caches/6.7/scripts/f0emg6u6oecmxqzgk5g9nn4ui).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 60
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 7s
Running Gradle task 'assembleDebug'...
Running Gradle task 'assembleDebug'... Done 9.2s
Exception: Gradle task assembleDebug failed with exit code 1我只想在我的android手机上运行flutter项目进行调试。那么,谁能告诉我这里的问题是什么?任何帮助都将非常感谢!
发布于 2021-03-26 13:17:48
出现错误时,请阅读错误信息。它清楚地说明了两件事,以及如何解决它们的步骤:
1:运行flutter doctor --android-licenses。
2:安装android studio。
3:在linux上从here安装android studio,不能使用snap。
发布于 2021-06-01 04:42:28
其中许多原因是由于从snap-craft或apt s/w package managers.Try安装软件,以使用相应网站上的原始软件链接下载并解压到适当的本地文件夹。
因为这些软件包管理器不会将软件更新到最新版本或最新的错误修复。
https://stackoverflow.com/questions/66811371
复制相似问题