Flutter A newer version of the Android SDK is required. To update, run: error?

蹲街弑〆低调 提交于 2020-08-26 07:37:09

问题


I install flutter but give some error. I know a lot of solution for this error but them are not fix for me. How can ı solve this problem ?

My JAVA_HOME at C:\Program Files\Java\jdk-13.0.2

  1. command
C:\Users\Flamador>flutter doctor --android-licenses

A newer version of the Android SDK is required. To update, run:
C:\Users\Flamador\AppData\Local\Android\Sdk\tools\bin\sdkmanager --update
  1. command
C:\Users\Flamador>C:\Users\Flamador\AppData\Local\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: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

ı try this command but ...

  1. command
set JAVA_OPTS=-XX:+IgnoreUnrecognizedVMOptions --add-modules java.se.ee

Again

  1. command
C:\Users\Flamador>C:\Users\Flamador\AppData\Local\Android\Sdk\tools\bin\sdkmanager --update
Error occurred during initialization of boot layer
java.lang.module.FindException: Module java.se.ee not found

回答1:


Not all modules are available by default in JDK 13. To solve your problem, its a lot easier if you set your JAVA_HOME to JDK 1.8 and run the update command.



来源:https://stackoverflow.com/questions/60567498/flutter-a-newer-version-of-the-android-sdk-is-required-to-update-run-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!