简体   繁体   English

Android 许可证状态未知的 Flutter 错误

[英]Flutter error for Android license status unknown

I tried to run flutter on my Windows 10 and getting some errors.我试图在我的 Windows 10 上运行 flutter 并遇到一些错误。 Trying to resolve error " Android license status unknown."正在尝试解决错误“Android 许可证状态未知”。 from the last couple of hours.从最近几个小时开始。 But no luck.但没有运气。 My system environment is like the followings:我的系统环境如下:

Windows 10, java version "12.0.2" 2019-07-16, Android Studio 3.5. Windows 10,Java 版本“12.0.2”2019-07-16,Android Studio 3.5。

Can anyone know the thing which I am missing here?谁能知道我在这里想念的东西?

C:\Users\me>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.7.8+hotfix.4, on Microsoft Windows [Version 10.0.17134.885], locale en-US)

[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    X Android license status unknown.
      Try re-installing or updating your Android SDK Manager.
      See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed
      instructions.
[!] Android Studio (version 3.5)
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
[√] VS Code, 64-bit edition (version 1.37.1)
[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

C:\Users\me>

I tried the following command ( flutter doctor --android-licenses ) and getting the errors like this:我尝试了以下命令( flutter doctor --android-licenses )并得到如下错误:

C:\Users\me>flutter doctor --android-licenses
A newer version of the Android SDK is required. To update, run:
C:\Users\me\AppData\Local\Android\sdk\tools\bin\sdkmanager --update



C:\Users\me>

Did you already accepted the licenses?您是否已经接受了许可证? If not, try如果没有,请尝试

flutter doctor --android-licenses

As shown in How to accept Android licenses如何接受 Android 许可证所示

Actually The Android License is not necessary to do.实际上不需要做 Android 许可证。 Just open the android studio and start a new flutter project and have fun!只需打开 android studio 并开始一个新的 Flutter 项目并玩得开心! If you want to do so.如果你想这样做。 Type the command: flutter doctor --android-licenses Have Fun!输入命令:flutter doctor --android-licenses 玩得开心!

I solved it.我解决了。 I set JDK_HOME and then run the following command to fix:我设置了 JDK_HOME,然后运行以下命令来修复:

flutter doctor --android-licenses

So, basically it was unable to configure JDK home and that error occurred.因此,基本上它无法配置 JDK home 并且发生了该错误。 Hopefully, it will solve issues if you face this error.希望如果您遇到此错误,它将解决问题。

Its worked me..它对我有用..

So here the solution, open your SDK manager then uncheck Hide Obsolete Packages所以这里是解决方案,打开您的 SDK 管理器,然后取消选中Hide Obsolete Packages

在此处输入图片说明

Now you'll see Android SDK Tools (Obsolete) 26.1.1 appears.现在您将看到Android SDK Tools (Obsolete) 26.1.1出现。 Tick that package and hit apply button then ok button.勾选那个包并点击apply button然后点击确定按钮。 it will download sdk.它会下载sdk。 then restart Android studio然后restart安卓工作室

Nice, now if you run flutter doctor , you should get positive result as below很好,现在如果你运行flutter doctor ,你应该得到如下的阳性结果

PS D:\Workplace\flutter_projects> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.12.13+hotfix.8, on Microsoft Windows [Version 10.0.18363.657], locale en-MY)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.6)
[√] VS Code (version 1.42.1)
[√] Connected device (1 available)

• No issues found!

PS D:\Workplace\flutter_projects> flutter doctor --android-licenses -v
All SDK package licenses accepted.======] 100% Computing updates...

Run flutter doctor --android-licenses and enter Y when is asked运行flutter doctor --android-licenses并在询问时输入 Y

Refer-- https://robbinespu.gitlab.io/blog/2020/03/03/flutter-issue-fixed-android-license-status-unknown-on-windows/参考-- https://robbinespu.gitlab.io/blog/2020/03/03/flutter-issue-fixed-android-license-status-unknown-on-windows/

if needed we can download package manually here https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip (for Windows user).如果需要,我们可以在此处手动下载软件包https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip (适用于 Windows 用户)。 Hope this tutorial help people who looking for solution希望本教程可以帮助寻找解决方案的人

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM