一、配置环境变量
1. Path= flutter\bin的全路径作为它的值
PUB_HOSTED_URL=https://pub.flutter-io.cn
FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
ANDROID_HOME=你的自定义SDK路径(需重启电脑)
powershell或者cmd 输入 flutter doctor(这个命令以查看是否需要安装任何依赖项来完成安装)
遇到的问题:
1、[✓] Flutter (on Linux, locale en_US.UTF-8, channel master)
[✗] 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.io/setup/#android-setup for detailed instructions).
If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.
[✓] Android Studio (version 3.0.0)
• Android Studio at /home/f/App/android-studio
• Gradle version 3.2
• Java version OpenJDK Runtime Environment (build 1.8.0_112-release-b06)
[✓] Connected devices(1 available)
解决方法
配置环境变量:ANDROID_HOME=你的自定义SDK路径(需重启电脑)
重启电脑之后有来了问题
C:\Users\1>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.2, on Microsoft Windows [Version 10.0.19042.985], locale zh-CN)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[√] Chrome - develop for the web
[√] Android Studio (version 4.1.0)
[√] Connected device (2 available)
! Doctor found issues in 1 category.
解决方法
C:\Users\1>flutter doctor --android-licenses
Warning: File C:\Users\1\.android\repositories.cfg could not be loaded.
6 of 7 SDK package licenses not accepted. 100% Computing updates...
Review licenses that have not been accepted (y/N)? y(一直y)
Flutter 安装 问题
最新推荐文章于 2023-05-31 23:15:17 发布