Android工具链-我为Android设备开发(Android SDK版本30.0.3):
X cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
Android工具链-我为Android设备开发(Android SDK版本30.0.3):
X cmdline-tools component is missing
Run `path/to/sdkmanager --install "cmdline-tools;latest"`
See https://developer.android.com/studio/command-line for more details.
当前回答
如果你是Mac用户,只需打开终端并粘贴:
cd Library/Android/sdk/tools/bin./sdkmanager --install "cmdline-tools;latest"
然后按Enter键。
该命令将安装最新版本的cmdline-tools。
那就去找扑动医生,错误就会消失。
其他回答
我在Windows 10上通过以下操作解决了这个问题:
Run the following command in a Windows command prompt or Flutter console: flutter config --android-sdk "C:\Users\'your computer name' AppData\Local\Android\Sdk" (you may need to find and enter your own SDK path) The Android SDK location could be found in the Android Studio application* → Appearance & Behavior → System Settings → Android SDK Open your Android Studio, and then → File → Settings → Appearance & Behavior → System Settings → Android SDK → SDK Tools → download Android SDK Command-line Tools (latest) and you are good to go.
Windows用户
如果您在构建工具之后仍然看到相同的错误,安装工具并将其添加到用户/系统路径变量中,可能您的sdkmanager位置确实没有找到
只要输入
flutter config --android-sdk "C:\Users\{Your_User_Name}\AppData\Local\Android\Sdk" # (Default SDK location)
将“”内的路径添加到Android SDK文件夹所在的位置 然后,您可以运行许可证来验证任何未批准的许可证。
这对我很管用。
我的解决过程如下:
~/Library/Android/sdk/tools/bin/sdkmanager --install "cmdline-tools;latest" 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:636) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519) ... 5 more Install Android SDK Command-line Tools in Android Studio: Preferences → Appearance & Behavior → System Settings → Android SDK → SDK Tools → Android SDK Command-line Tools (latest) flutter doctor Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 2.5.0, on macOS 11.5.2 20G95 darwin-x64, locale zh-Hans-CN) [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) [✓] Xcode - develop for iOS and macOS [✓] Chrome - develop for the web [✓] Android Studio (version 2020.3) [✓] IntelliJ IDEA Ultimate Edition (version 2021.2) [✓] IntelliJ IDEA Ultimate Edition (version 2021.2) [✓] Connected device (2 available) • No issues found!
你必须安装Android SDK命令行工具。 要做到这一点,调用菜单命令File→Settings→Android SDK并下载最新的。
您必须在“设置”窗口左侧选择“Android SDK”。在“外观与行为”→“系统设置”下。
如果您已经下载了cmdline-tools和Android SDK,请确保Flutter没有在错误的目录中查找:
flutter config --android-sdk=""