当我运行“ flutter doctor --android-licenses ”命令时,出现以下错误
A newer version of the Android SDK is required. To update, run:
/Users/taleb/Library/Android/sdk/tools/bin/sdkmanager --update
注意:
* my android SDK is updated
* I added all of the paths to 'bash_profile' (mac)
这是我的' bash_profile '
export PATH="$PATH:/Users/taleb/Library/Android/sdk/platform-tools"
export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
export PATH="$PATH:/Users/taleb/Developer/flutter/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:602)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 5 more
答案 0 :(得分:2)
打开android studio,工具>> SDK管理器>> SDK平台
下载API级别为(29)的平台,然后单击“应用”,
之后运行flutter doctor