部署.AsyncDevicesGetter - adb未找到

7

我安装了Android Studio 4.0,添加了Flutter插件,并已安装好Flutter。Flutter doctor也显示一切运行良好。

> C:\Users\Alvin>flutter doctor 
> Doctor summary (to see all details, run flutter doctor -v): 
> [√] Flutter (Channel beta, 1.19.0-4.1.pre, on Microsoft Windows [Version 10.0.18363.900], locale en-US)
> [√] Android toolchain - develop for Android devices (Android SDK version 30.0.0) 
> [√] Android Studio (version 4.0) [√] VS Code (version 1.45.1) 
> [√] Connected device (1 available)
> 
>No issues found!

可是当我打开AVD管理器并在模拟器中启动AVD时,也出现了一个弹窗enter image description here

但实际上adb已经安装在C:\Users\Alvin\AppData\Local\Android\Sdk\platform-tools中了。 所以我将该路径添加到环境变量PATH中以包括此目录,这样我就可以从命令提示符的任何位置调用adb。

但是每次启动AVD时,仍会弹出同样的“无法找到adb”的消息。 实际上,如果我生成一个简单的Flutter程序并在连接到USB的手机上运行它,则它可以在手机设备中工作。

基于好奇心,我试图弄清楚实际发生了什么。 我打开了idea.log日志文件(使用帮助->在资源管理器中显示日志打开)。 我发现系统实际上正在尝试查找ANDROID_HOME和ANDROID_SDK_ROOT。 在我设置它们之后,Android Studio似乎正常运行,但仍有一条令人烦恼的消息:.deployment.AsyncDevicesGetter-未找到adb. 即使只是INFO,我怀疑这就是启动AVD Manager时遇到的问题。 日志列表如下:

2020-06-19 22:50:39,009 [      0]   INFO -        #com.intellij.idea.Main - ------------------------------------------------------ IDE STARTED ------------------------------------------------------ 
2020-06-19 22:50:39,213 [    204]   INFO -        #com.intellij.idea.Main - JNA library (64-bit) loaded in 154 ms 
2020-06-19 22:50:39,610 [    601]   INFO -        #com.intellij.idea.Main - IDE: Android Studio (build #AI-193.6911.18.40.6514223, 20 May 2020 22:07) 
2020-06-19 22:50:39,610 [    601]   INFO -        #com.intellij.idea.Main - OS: Windows 10 (10.0, amd64) 
2020-06-19 22:50:39,610 [    601]   INFO -        #com.intellij.idea.Main - JRE: 1.8.0_242-release-1644-b01 (JetBrains s.r.o) 
2020-06-19 22:50:39,610 [    601]   INFO -        #com.intellij.idea.Main - JVM: 25.242-b01 (OpenJDK 64-Bit Server VM) 
2020-06-19 22:50:39,614 [    605]   INFO -        #com.intellij.idea.Main - JVM Args: exit -Xms256m -Xmx1280m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -XX:CICompilerCount=2 -Dsun.io.useCanonPrefixCache=false -Djava.net.preferIPv4Stack=true -Djdk.http.auth.tunneling.disabledSchemes="" -Djdk.attach.allowAttachSelf=true -Dkotlinx.coroutines.debug=off -Djdk.module.illegalAccess.silent=true -Djna.nosys=true -Djna.boot.library.path= -Djb.vmOptionsFile=C:\Program Files\Android\Android Studio\bin\studio64.exe.vmoptions -Djava.library.path=C:\Program Files\Android\Android Studio\jre\jre\bin;C:\Program Files\Android\Android Studio\jre\jre\bin\server -Didea.platform.prefix=AndroidStudio -Didea.jre.check=true -Dide.native.launcher=true -Didea.paths.selector=AndroidStudio4.0 -XX:ErrorFile=C:\Users\Alvin\java_error_in_studio_%p.log -XX:HeapDumpPath=C:\Users\Alvin\java_error_in_studio.hprof 
2020-06-19 22:50:39,618 [    609]   INFO -        #com.intellij.idea.Main - ext: C:\Program Files\Android\Android Studio\jre\jre\lib\ext: [access-bridge-64.jar, cldrdata.jar, dnsns.jar, jaccess.jar, localedata.jar, meta-index, nashorn.jar, sunec.jar, sunjce_provider.jar, sunmscapi.jar, sunpkcs11.jar, zipfs.jar] 
2020-06-19 22:50:39,618 [    609]   INFO -        #com.intellij.idea.Main - charsets: JNU=Cp1252 file=Cp1252 
2020-06-19 22:50:39,635 [    626]   INFO - ntellij.idea.ApplicationLoader - CPU cores: 4; ForkJoinPool.commonPool: java.util.concurrent.ForkJoinPool@c001ec7[Running, parallelism = 3, size = 0, active = 0, running = 0, steals = 0, tasks = 0, submissions = 0]; factory: com.intellij.concurrency.IdeaForkJoinWorkerThreadFactory@d88ff34 
2020-06-19 22:50:39,985 [    976]   INFO - penapi.util.io.win32.IdeaWin32 - Native filesystem for Windows is operational 
2020-06-19 22:50:40,976 [   1967]   INFO - llij.ide.plugins.PluginManager - Plugin "Groovy" misses optional descriptor duplicates-groovy.xml 
2020-06-19 22:50:40,978 [   1969]   INFO - llij.ide.plugins.PluginManager - Plugin "Groovy" misses optional descriptor duplicates-detection-groovy.xml 
2020-06-19 22:50:41,360 [   2351]   INFO - llij.ide.plugins.PluginManager - Plugin "Java" misses optional descriptor profiler-java.xml 
2020-06-19 22:50:41,532 [   2523]   INFO - llij.ide.plugins.PluginManager - Loaded bundled plugins: Android APK Support (1.0), Android Games (1.0), Android NDK Support (1.0), Android Support (10.4.0), App Links Assistant (0.1), ChangeReminder (193.6911.18.40.6514223), Compose (0.1.0-dev03), Configuration Script (193.6911.18.40.6514223), Copyright (193.6911.18.40.6514223), Coverage (193.6911.18.40.6514223), EditorConfig (193.6911.18.40.6514223), Firebase App Indexing (0.1), Firebase Services (0.1), Firebase Testing (1.0), Git (193.6911.18.40.6514223), GitHub (193.6911.18.40.6514223), Google Cloud Tools Core (0.2.8), Google Cloud Tools For Android Studio (0.2.8), Google Developers Samples (0.3.1), Google Login (1.0), Google Services (0.1), Gradle (193.6911.18.40.6514223), Gradle-Java (193.6911.18.40.6514223), Groovy (193.6911.18.40.6514223), IDEA CORE (193.6911.18.40.6514223), IntelliLang (193.6911.18.40.6514223), JUnit (193.6911.18.40.6514223), Java (193.6911.18.40.6514223), Java Bytecode Decompiler (193.6911.18.40.6514223), Java IDE Customization (193.6911.18.40.6514223), Java Internationalization (193.6911.18.40.6514223), Java Stream Debugger (193.6911.18.40.6514223), Kotlin (1.3.72-release-Studio4.0-1), Layoutlib Native (1.0), Layoutlib Standard (1.0), Mercurial (193.6911.18.40.6514223), Properties (193.6911.18.40.6514223), Settings Repository (193.6911.18.40.6514223), Shell Script (193.6911.18.40.6514223), Smali Support (193.6911.18.40.6514223), Subversion (193.6911.18.40.6514223), Task Management (193.6911.18.40.6514223), Terminal (193.6911.18.40.6514223), Test Recorder (1.0), TestNG (193.6911.18.40.6514223), TextMate bundles (193.6911.18.40.6514223), YAML (193.6911.18.40.6514223) 
2020-06-19 22:50:41,532 [   2523]   INFO - llij.ide.plugins.PluginManager - Loaded custom plugins: Dart (193.7361), Flutter (46.0.2) 
2020-06-19 22:50:43,023 [   4014]   INFO - ellij.util.io.PagedFileStorage - lower=100; upper=500; buffer=10; max=1226 
2020-06-19 22:50:43,053 [   4044]   INFO - tellij.util.io.FileChannelUtil - interruptible FileChannel-s will be used for indexes 
2020-06-19 22:50:43,295 [   4286]   INFO - rains.ide.BuiltInServerManager - built-in server started, port 63342 
2020-06-19 22:50:43,425 [   4416]   INFO - til.net.ssl.CertificateManager - Default SSL context initialized 
2020-06-19 22:50:43,444 [   4435]   INFO - pl.local.NativeFileWatcherImpl - Starting file watcher: C:\Program Files\Android\Android Studio\bin\fsnotifier64.exe 
2020-06-19 22:50:43,529 [   4520]   INFO - pl.local.NativeFileWatcherImpl - Native file watcher is operational. 
2020-06-19 22:50:43,558 [   4549]   INFO - com.intellij.ide.ui.UISettings - Loaded: fontSize=13, fontScale=1.0; restored: fontSize=13, fontScale=1.0 
2020-06-19 22:50:43,597 [   4588]   INFO - gs.impl.UpdateCheckerComponent - channel: release 
2020-06-19 22:50:44,105 [   5096]   WARN - nSystem.impl.ActionManagerImpl - keymap "ReSharper" not found [Plugin: com.android.tools.ndk] 
2020-06-19 22:50:45,429 [   6420]   WARN - ins.android.sdk.AndroidSdkData - Observed package id 'platform-tools' in inconsistent location 'C:\Users\Alvin\AppData\Local\Android\Sdk\platform-tools.old' (Expected 'C:\Users\Alvin\AppData\Local\Android\Sdk\platform-tools') 
2020-06-19 22:50:45,429 [   6420]   WARN - ins.android.sdk.AndroidSdkData - Already observed package id 'platform-tools' in 'C:\Users\Alvin\AppData\Local\Android\Sdk\platform-tools'. Skipping duplicate at 'C:\Users\Alvin\AppData\Local\Android\Sdk\platform-tools.old' 
2020-06-19 22:50:45,650 [   6641]   INFO - pl$FileIndexDataInitialization - Initialization done: 1992 
2020-06-19 22:50:46,465 [   7456]   INFO - exImpl$StubIndexInitialization - Initialization done: 799 
2020-06-19 22:50:50,013 [  11004]   INFO - artup.AndroidStudioInitializer - Failed to disable 'org.intellij.plugins.intelliLang.inject.groovy.GrConcatenationInjector' 
2020-06-19 22:50:50,175 [  11166]   INFO - j.ide.script.IdeStartupScripts - 0 startup script(s) found 
2020-06-19 22:50:51,671 [  12662]   WARN - ugins.textmate.TextMateService - Missing builtin bundles, checked: 
C:/Users/Alvin/.AndroidStudio4.0/config/plugins/textmate/lib/bundles
C:/Program Files/Android/Android Studio/plugins/textmate/lib/bundles 
2020-06-19 22:50:51,712 [  12703]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:50:52,412 [  13403]   INFO - lutter.run.daemon.DeviceDaemon - starting Flutter device daemon #1: C:/flutterSDK/flutter/bin/flutter.bat daemon 
2020-06-19 22:50:52,420 [  13411]   INFO - #io.flutter.sdk.FlutterCommand - C:\flutterSDK\flutter\bin\flutter.bat [--no-color, config, --machine] 
2020-06-19 22:50:52,441 [  13432]   INFO -     #io.flutter.sdk.FlutterSdk - Calling config --machine 
2020-06-19 22:50:53,707 [  14698]   INFO - .diagnostic.PerformanceWatcher - Pushing properties took 493ms; general responsiveness: ok; EDT responsiveness: ok 
2020-06-19 22:50:53,804 [  14795]   WARN - com.intellij.util.xmlb.Binding - no accessors for class org.jetbrains.kotlin.idea.highlighter.KotlinDefaultHighlightingSettingsProvider 
2020-06-19 22:50:54,741 [  15732]   INFO - .diagnostic.PerformanceWatcher - Indexable file iteration took 1032ms; general responsiveness: ok; EDT responsiveness: ok 
2020-06-19 22:50:55,874 [  16865]   INFO -       #com.jetbrains.cidr.lang - Clearing symbols finished in 588 ms 
2020-06-19 22:50:56,113 [  17104]   INFO -       #com.jetbrains.cidr.lang - Building symbols in FAST mode, 0 source files from total 0 project files 
2020-06-19 22:50:56,597 [  17588]   INFO - ngd.lsp.ClangDaemonContextImpl - Using clangd from: C:\Program Files\Android\Android Studio\bin\clang\win\clangd.exe 
2020-06-19 22:50:56,651 [  17642]   INFO -       #com.jetbrains.cidr.lang - Loading symbols finished in 647 ms 
2020-06-19 22:50:56,678 [  17669]   INFO -       #com.jetbrains.cidr.lang - Loading Header Maps finished in 27 ms 
2020-06-19 22:50:56,730 [  17721]   INFO - #io.flutter.sdk.FlutterCommand - C:\flutterSDK\flutter\bin\flutter.bat [--no-color, config, --machine] 
2020-06-19 22:50:56,733 [  17724]   INFO -     #io.flutter.sdk.FlutterSdk - Calling config --machine 
2020-06-19 22:50:57,254 [  18245]   INFO -       #com.jetbrains.cidr.lang - Loading Module Maps finished in 543 ms 
2020-06-19 22:50:57,279 [  18270]   INFO - .diagnostic.PerformanceWatcher - Post-startup activities under progress took 5678ms; general responsiveness: 1/6 sluggish; EDT responsiveness: 3/5 sluggish 
2020-06-19 22:50:57,282 [  18273]   INFO -       #com.jetbrains.cidr.lang - Loaded 0 module maps in 0 packs for 0 search roots 
2020-06-19 22:50:57,304 [  18295]   INFO -       #com.jetbrains.cidr.lang - Saved 0 module maps in 0 packs 
2020-06-19 22:50:57,326 [  18317]   INFO -       #com.jetbrains.cidr.lang - Saving Module Maps finished in 23 ms 
2020-06-19 22:50:57,326 [  18317]   INFO -       #com.jetbrains.cidr.lang - Loaded 0 tables for 0 files (0 project files) 
2020-06-19 22:50:57,327 [  18318]   INFO -       #com.jetbrains.cidr.lang - Building symbols for 0 source files 
2020-06-19 22:50:57,360 [  18351]   INFO -       #com.jetbrains.cidr.lang - Updating Symbols finished in 24 ms 
2020-06-19 22:50:57,363 [  18354]   INFO -       #com.jetbrains.cidr.lang - Building symbols for 0 unused headers 
2020-06-19 22:50:57,368 [  18359]   INFO -       #com.jetbrains.cidr.lang - Updating Symbols finished in 5 ms 
2020-06-19 22:50:57,368 [  18359]   INFO -       #com.jetbrains.cidr.lang - Updating Symbols finished in 5 ms 
2020-06-19 22:50:57,402 [  18393]   INFO -       #com.jetbrains.cidr.lang - Saving modified symbols for 0 files (0 tables of total 0) 
2020-06-19 22:50:57,414 [  18405]   INFO -       #com.jetbrains.cidr.lang - Saving symbols finished in 12 ms 
2020-06-19 22:50:57,446 [  18437]   INFO -     #io.flutter.sdk.FlutterSdk - Timeout when calling flutter config --machine 
2020-06-19 22:50:57,481 [  18472]   INFO - tartup.impl.StartupManagerImpl - C:/Projects/android/Flutter/first_flutter_app/.idea case-sensitivity: expected=false actual=false 
2020-06-19 22:50:57,694 [  18685]   INFO - ge.ExternalProjectsDataStorage - Load external projects data in 8 millis (read time: 1) 
2020-06-19 22:50:57,827 [  18818]   INFO - tor.impl.FileEditorManagerImpl - Project opening took 11239 ms 
2020-06-19 22:50:57,872 [  18863]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:50:58,214 [  19205]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:50:58,909 [  19900]   INFO - CompilerWorkspaceConfiguration - Available processors: 4 
2020-06-19 22:50:58,946 [  19937]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:50:59,228 [  20219]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:50:59,730 [  20721]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:51:00,306 [  21297]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:51:00,759 [  21750]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:51:01,274 [  22265]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:51:01,783 [  22774]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:51:02,222 [  23213]   INFO -     #io.flutter.sdk.FlutterSdk - Timeout when calling flutter config --machine 
2020-06-19 22:51:02,288 [  23279]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:51:02,789 [  23780]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:51:03,640 [  24631]   INFO - j.ide.plugins.RepositoryHelper - using cached plugin list (updated at 6/19/2020 8:30 PM) 
2020-06-19 22:51:06,694 [  27685]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:51:07,458 [  28449]   INFO - j.ide.actions.RevealFileAction - 
Exit code 1 
2020-06-19 22:51:09,822 [  30813]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:51:15,262 [  36253]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:51:15,362 [  36353]   INFO - mponents.impl.stores.StoreUtil - saveProjectsAndApp took 1126 ms 
2020-06-19 22:51:19,857 [  40848]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:51:59,968 [  80959]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:52:04,295 [  85286]   INFO - rationStore.ComponentStoreImpl - Saving appHttpConfigurable took 16 ms 
2020-06-19 22:52:04,326 [  85317]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:52:04,342 [  85333]   INFO - rationStore.ComponentStoreImpl - Saving Project (name=first_flutter_app, containerState=ACTIVE, componentStore=C:\Projects\android\Flutter\first_flutter_app) ProjectCodeStyleConfiguration took 16 ms 
2020-06-19 22:56:13,286 [ 334277]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:56:13,786 [ 334777]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:56:14,301 [ 335292]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:56:14,817 [ 335808]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:56:15,332 [ 336323]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:56:17,379 [ 338370]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:56:19,925 [ 340916]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:56:20,956 [ 341947]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:56:21,472 [ 342463]   INFO - .deployment.AsyncDevicesGetter - adb not found 
2020-06-19 22:56:23,504 [ 344495]   INFO - .deployment.AsyncDevicesGetter - adb not found 

是否有关于我面临的问题以及如何解决的任何信息可以分享? 附加信息: adb版本:30.0.3-6597393 Java版本:1.8.0_121

4个回答

1

在Stackoverflow上花了好几天也没得到任何回应后,我尝试了不同的方法。我彻底卸载了Android Studio 4.0,包括Android SDK。 然后我安装了Android Studio 3.4,并将Android SDK设置在自己创建的文件夹中,而不是在C:\Users{name}\android...中。我安装好了它,然后在环境变量中设置了ANDROID_HOME和ANDROID_SDK_HOME。将ANDROID_HOME放在路径列表中,然后启动Android Studio。ADB工作正常,一切都正常运行。 过了一会儿,我点击了升级提示来升级到Android Studio 4.0。一切正常运行。然后我安装了flutter插件。 现在一切都完美运行。 但我仍然不知道为什么我第一次出现了问题。 我只知道通过重新安装,现在一切都完美运行。


1
我也遇到了这个问题。重新安装没有解决问题。在日志文件中,我发现了有问题的ZIP文件。它是gradle-6.1.1-all.zip,下载链接来自https://services.gradle.org/distributions/。它需要在C:\ Users \ xxxYourNamexxx \ .gradle \ wrapper \ dists \ gradle-6.1.1-all \ cfmwm155h49vnt3hynmlrsdst中被替换。我替换了它,然后问题得到了解决。

谢谢你的见解。我没有意识到这一点。我会去查一下。再次感谢你。 - Alvin Sanusi

0

您可能需要将adb添加到您的PATH中。

检查ADB是否已安装: ~/Library/Android/sdk/platform-tools/adb

如果没有打印出来,您需要安装adb:

  1. 启动Android Studio
  2. 通过工具 -> Android -> SDK Manager启动SDK Manager
  3. 检查Android SDK Platform-Tools

如果打印出来了,请运行echo export "PATH=~/Library/Android/sdk/platform-tools:$PATH" >> ~/.bash_profile

重新启动终端,您应该可以使用adb了!通过运行adb验证adb是否正常工作。


0

遇到类似的问题。结果发现是 Android SDK 的问题。

  1. 导航到SDK文件夹
  2. 删除该文件夹
  3. 使用 Android Studio 重新下载 SDK

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接