flutter - Flutter 未安装在 UBUNTU 20.04 LTS 上
问题描述
我在 Ubuntu 20.04 LTS 上。我安装了颤振 SDK sudo snap install flutter --classic
,然后我安装了 android studio,sudo snap install andriod-studio --classic
但是当我
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 categories
N 当我在 VS 代码中打开任何颤振项目并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 手机上运行颤振项目进行调试。所以有人可以告诉我这里的问题吗?任何帮助,将不胜感激!!!
解决方案
Read the errors when they appear. It's clearly saying two things, with steps how to solve them:
1: run flutter doctor --android-licenses
.
2: install android studio.
3: Install android studio from here on linux, not by using snap.
推荐阅读
- python - 我收到一个 ValueError:所有边界框都应该有正的高度和宽度
- python - 通过for循环django显示两个对象
- ruby-on-rails - 在 Rails 和 Sinatra 之间通过 memcached 共享数据时,如何修复 Sinatra 不处理 ActiveSupport
- python - pytest 不会运行子目录中的测试文件
- php - 控制器的特征或服务
- python-3.x - Python + Selenium 单击叠加层中的表单按钮
- airflow - 从一个 DAG 生成多个并行任务
- reactjs - 编辑表单 React JS
- c - 如何存储不同 C 文件的输入字符串的名称?
- oracle - 避免在 Oracle 过程中频繁调用同一视图