颤抖找不到Android SDK [英] Android SDK cannot be found by flutter
问题描述
我已经通过AUR安装了 flutter
.我还安装了aur/android-sdk 26.0.2-1
.当我运行flutter run
时,我得到:
I have installed flutter
through AUR. I also have aur/android-sdk 26.0.2-1
installed. When I run flutter run
I get:
Warning! This package referenced a Flutter repository via the .packages file that is
no longer available. The repository from which the 'flutter' tool is currently
executing will be used instead.
running Flutter tool: /home/dair/.flutter-sdk
previous reference : /home/dair/flutter
This can happen if you deleted or moved your copy of the Flutter repository, or
if it was on a volume that is no longer mounted or has been mounted at a
different location. Please check your system path to verify that you are running
the expected version (run 'flutter --version' to see which flutter is on your path).
Unable to locate a development device; please run 'flutter doctor' for information about installing additional components.
首先,我运行flutter --version
,并收到:
Firstly, I ran flutter --version
, and received:
Flutter • channel alpha • https://github.com/flutter/flutter.git
Framework • revision e2f54df5ab (9 days ago) • 2017-06-02 10:43:54 -0700
Engine • revision 1f2aa07571
Tools • Dart 1.24.0-dev.3.0
不确定查看路径上的颤动"到底意味着什么.接下来,我运行flutter doctor
并得到:
Not sure what exactly it means by "to see which flutter is on your path". Next I ran flutter doctor
and got:
[✓] Flutter (on Linux, locale en_US.UTF-8, channel alpha)
• Flutter at /home/christopher/.flutter-sdk
• Framework revision e2f54df5ab (9 days ago), 2017-06-02 10:43:54 -0700
• Engine revision 1f2aa07571
• Tools Dart version 1.24.0-dev.3.0
[✗] Android toolchain - develop for Android devices
✗ ANDROID_HOME = /opt/android-sdk
but Android SDK not found at this location.
[✓] Android Studio (version 2.3)
• Android Studio at /usr/local/android-studio
• Gradle version 3.2
• Java version: OpenJDK Runtime Environment (build 1.8.0_112-release-b06)
[✓] Connected devices
• None
但是,如果我进入/opt/android-sdk
,我会得到:
However, if I cd into /opt/android-sdk
I get:
➜ ~ cd /opt/android-sdk
➜ android-sdk ls
add-ons build-tools emulator platforms tools
所以看起来好像在那里.我能找到的最接近的问题是这个问题: React Native android build失败的.找不到SDK位置,但似乎使用的是Mac,而不是arch和其他一些区别.如何解决flutter doctor
并运行我的应用?
So it looks like it is there. The closest question I could find is this one: React Native android build failed. SDK location not found but it seems to be using Mac as opposed to arch as well as some other differences. How can I resolve the flutter doctor
and have my app run?
推荐答案
如果您使用的是Android Studio 3,则可以通过转到文件->项目结构并选择平台SDK来配置平台SDK.
If you're using Android Studio 3 , you can configure your platform SDK by going to File -> Project structure and choose your platform sdk.
希望这对您有用.
这篇关于颤抖找不到Android SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!