我将Android Studio升级到3.1.2,当我想使用Device File Explorer
时,我得到了"错误初始化ADB:找不到Android调试桥。"错误,但是,我的adb在cmd和powershell中工作正常,我该如何解决这个错误呢?从错误消息中我发现在一个名为Android Support
的插件中有一个Exception,在我的计算机上它的版本是10.3.1.2。
流动是错误消息:
ADB not found
com.intellij.openapi.diagnostic.Logger$EmptyThrowable
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:140)
at com.android.tools.idea.explorer.adbimpl.AdbDeviceFileSystemService.start(AdbDeviceFileSystemService.java:107)
at com.android.tools.idea.explorer.DeviceExplorerController.setup(DeviceExplorerController.java:139)
at com.android.tools.idea.explorer.DeviceExplorerToolWindowFactory.createToolWindowContent(DeviceExplorerToolWindowFactory.java:51)
at com.intellij.openapi.wm.impl.ToolWindowImpl.ensureContentInitialized(ToolWindowImpl.java:573)
at com.intellij.openapi.wm.impl.ToolWindowImpl.getContentManager(ToolWindowImpl.java:407)
at com.intellij.openapi.wm.impl.commands.RequestFocusInToolWindowCmd.processRequestFocus(RequestFocusInToolWindowCmd.java:73)
at com.intellij.openapi.wm.impl.commands.RequestFocusInToolWindowCmd.lambda$run$0(RequestFocusInToolWindowCmd.java:61)
at com.intellij.openapi.util.ExecutionCallback.doWhenExecuted(ExecutionCallback.java:100)
at com.intellij.openapi.util.ActionCallback.doWhenDone(ActionCallback.java:111)
at com.intellij.openapi.wm.impl.commands.RequestFocusInToolWindowCmd.run(RequestFocusInToolWindowCmd.java:61)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.ToolWindowsPane$AddDockedComponentCmd.run(ToolWindowsPane.java:768)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:93)
at com.intellij.openapi.wm.impl.CommandProcessor.run(CommandProcessor.java:74)
at com.intellij.openapi.wm.impl.commands.FinalizableCommand.finish(FinalizableCommand.java:36)
at com.intellij.openapi.wm.impl.commands.ApplyWindowInfoCmd.run(ApplyWindowInfoCmd.java:50)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.runNextEvent(LaterInvocator.java:424)
at com.intellij.openapi.application.impl.LaterInvocator$FlushQueue.run(LaterInvocator.java:407)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:762)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:732)
at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:822)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:650)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:366)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
答案 0 :(得分:0)
我和另一个程序有类似的问题。 问题是我的机器上的另一个屏幕共享程序正在打开一个旧的ADB服务器,导致程序和手机之间的沟通错误。
答案 1 :(得分:0)
未授权ADB访问设备时出现此问题。
如果Android Studio可以在未将设备连接到计算机的情况下初始化ADB,则问题可能与此问题有关。
要解决此问题,我从终端启动了adb服务器,对其进行了授权,然后重新启动了Android Studio。
答案 2 :(得分:0)
在android studio中,File -> Project Structure -> Module -> Your projectname_android-> dependencies->modules sdk: (select api as android api platform),
,然后单击“应用”,然后单击“确定”。
在我的情况下,which adb
输出/usr/local/bin/adb
ls -la
/ usr / local / bin / adb
/usr/local/bin/adb -> <path to correct adb location which is mentioned in sdk in android studio.
完成这些步骤后,问题已解决。