我正试图在Ubuntu中为flutter开发设置vscode,但我在查找android SDK和接受许可证时遇到了问题。我安装了android studio,并在SDK管理器中勾选了所有内容,然后将flutter配置更改为android SDK路径,但仍然存在相同的错误。
--> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 2.8.1, on Ubuntu 20.04.3 LTS 5.13.0-25-generic,
locale en_US.UTF-8)
[!] Android toolchain - develop for Android devices (Android SDK version 27.0.1)
✗ Flutter requires Android SDK 29 and the Android BuildTools 28.0.3
To update the Android SDK visit
https://flutter.dev/docs/get-started/install/linux#android-setup for
detailed instructions.
✗ 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 (version 2021.1)
[✓] VS Code (version 1.63.2)
[✓] Connected device (1 available)
当我尝试接受许可证时,我得到了这个
--> flutter doctor --android-licenses
Android sdkmanager not found. Update to the latest Android SDK and ensure that
the cmdline-tools are installed to resolve this.
看起来你有Android SDK版本27,但Flutter需要29。
因此,你应该安装所需的sdk或更高版本。
我不得不重新启动我的笔记本电脑,然后在vscode终端flutter config-android-sdk"中再次运行此命令;PATH TO ANDROID SDK",现在它工作了!
对我来说,Abo_nosa的解决方案不起作用,但我能够通过安装sdkmager来解决问题,遵循以下步骤