Android SDK中的adb未安装或未在Windows 10上正确配置

Android SDK中的adb未安装或未在Windows 10上正确配置,android,nativescript,Android,Nativescript,我正在尝试在我的计算机上安装Nativescript CLI,我已经完成了网站上列出的所有步骤。当我运行tns-doctor时,我得到以下输出: C:\WINDOWS\system32>tns doctor √ Getting environment information TIP: To avoid setting up the necessary environment variables, you can use the chocolatey package manager to

我正在尝试在我的计算机上安装Nativescript CLI,我已经完成了网站上列出的所有步骤。当我运行
tns-doctor
时,我得到以下输出:

C:\WINDOWS\system32>tns doctor
√ Getting environment information

TIP: To avoid setting up the necessary environment variables, you can use the chocolatey package manager to install the Android SDK and its dependencies.

There seem to be issues with your configuration.
√ Getting NativeScript components versions information...
√ Component nativescript has 6.0.1 version and is up to date.
√ Your ANDROID_HOME environment variable is set and points to correct directory.
√ The Android SDK is installed.
√ Javac is installed and is configured properly.
√ The Java Development Kit (JDK) is installed and is configured properly.
√ Local builds for iOS can be executed only on a macOS system. To build for iOS on a different operating system, you can use the NativeScript cloud infrastructure.
× WARNING: adb from the Android SDK is not installed or is not configured properly.
 For Android-related operations, the NativeScript CLI will use a built-in version of adb.
To avoid possible issues with the native Android emulator, Genymotion or connected
Android devices, verify that you have installed the latest Android SDK and
its dependencies as described in http://developer.android.com/sdk/index.html#Requirements

× Cannot find a compatible Android SDK for compilation. To be able to build for Android, install Android SDK 28 or later.
 Run `$ sdkmanager` to manage your Android SDK versions.

× You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=23 <=28'.
 Run `$ sdkmanager` from your command-line to install required `Android Build Tools`. In case you already have them installed, make sure `ANDROID_HOME` environment variable is set correctly.
我已经检查了我的JAVA_HOME和ANDROID_HOME环境变量,它们是正确的,并且与cmd输出相匹配

我还尝试卸载和重新安装Nativescript CLI。我得到了完全相同的结果


安装Android Studio可能会导致此问题吗?

我认为问题在于您安装的Java版本。波斯特详细讨论了这个问题
sdkmanager
似乎与较新的Java版本存在问题


最简单的修复方法可能是降级到Java8。如果您不想降级到Java 8,您可以尝试设置上面帖子中提到的一些Java选项。

回答这个问题太晚了,但希望这个解决方案能帮助其他人

当我在Nativescript中开发应用程序并使用android设备进行测试时,我遇到了同样的问题

在调试和重新安装了所有东西之后,我决定先测试adb 因此,我测试了命令
adb设备
,结果出现错误:

adb.exe F 01-27 22:35:19 6364 9128 fdevent_poll.cpp:64]无法创建fdevent中断socketpair:无效参数

我找到了解决上述问题的办法
netsh winsock重置


重置winsock后,我终于能够解决问题。

这似乎有助于暴露问题所在,但仍然有一个问题我无法解决。我编辑了我的帖子来反映。考虑到结果,我认为可以肯定地说,问题不在于我的Java;而是我的Android或Nativescript CLI。我相信问题可能在于您安装的Java版本。我曾经在
sdkmanager
中遇到过类似的问题,我通过返回Java8详细讨论这个问题来修复它。
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