安装flutter时,Android许可证状态未知?

时间:2019-08-23 04:48:26

标签: android flutter macos-mojave

嗨,我正在尝试在macOS中安装flutter。运行flutter doctor命令时出现错误 Android许可证状态未知。我尝试使用Flutter.io Android License Status Unknown来解决它 但是我又遇到了一个错误:

A newer version of the Android SDK is required. To update, run:
/Users/bsikriwal/Library/Android/sdk/tools/bin/sdkmanager --update

当我运行/Users/bsikriwal/Library/Android/sdk/tools/bin/sdkmanager --update时 我收到另一个错误消息,如下所示:

Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
    at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
    at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
    at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 5 more

有帮助吗?

谢谢。

2 个答案:

答案 0 :(得分:1)

flutter doctor --android-licenses应该为您工作,如果不检查您的Java版本。降级吧?

答案 1 :(得分:0)

尝试这些:

1   Open your terminal

2   type flutter doctor --android-licenses

3   press y to accept every license.