无法在 Intellij 中调试 android 应用程序:“警告:调试信息可能不可用。”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20563147/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-20 03:03:00  来源:igfitidea点击:

Cannot debug android app in Intellij: "Warning: debug info can be unavailable."

androiddebuggingintellij-idea

提问by BHuelse

I am trying to debug an app with Intellij13.0 on Windows 7. Whenever I start debugging I get the following warning:

我正在尝试Intellij在 Windows 7 上使用13.0调试应用程序。每当我开始调试时,我都会收到以下警告:

Warning: debug info can be unavailable. Please close other application using ADB: Monitor, DDMS, Eclipse"

警告:调试信息可能不可用。请使用 ADB 关闭其他应用程序:Monitor、DDMS、Eclipse”

I have tested it on a device and in the emulator. The only thing I have open is Intellij. I tried also with closing adb before I start debugging, but nothing changed.

我已经在设备和模拟器中对其进行了测试。我唯一打开的是 Intellij。在开始调试之前,我也尝试关闭 adb,但没有任何改变。

best regards

此致

[EDIT] I solved it, by updating my android SDK build tools to 18.1.1.

[编辑] 我通过将我的 android SDK 构建工具更新到 18.1.1 来解决它。

回答by Levor

For me this situation occured when device was connected via usb and adb tcpipwas enabled (ADB in Wi-Fi mode).

对我来说,这种情况发生在设备通过 USB 连接并adb tcpip启用时(Wi-Fi 模式下的 ADB)。

Just run command adb usbwith connected device and try to debug again.

只需adb usb使用连接的设备运行命令并再次尝试调试。

回答by Kristy Welsh

I used adb kill-serverin the console to get the Logcat to appear. Running Android Studio 1.02.

adb kill-server在控制台中使用以使 Logcat 出现。运行 Android Studio 1.02。

回答by Saikrishna Rajaraman

Turn the USB Debugging on Device in Developer Options to off. And then switch it back on. This solved the issue in my case.

将开发人员选项中的设备上的 USB 调试关闭。然后重新打开它。这解决了我的问题。

UPDATE

更新

One more thing which fixed my case was clearing all existing breakpoints. And then trying to debug again.

解决我的问题的另一件事是清除所有现有的断点。然后再次尝试调试。

回答by Greta Radisauskaite

For those who are using Android-Studio: check your gradle file and product flavours and be sure that "debuggable" attribute in manifest is NOT set to false.

对于使用 Android-Studio 的用户:检查您的 gradle 文件和产品风格,并确保清单中的“debuggable”属性未设置为 false。

回答by Mina Fawzy

Firstmake sure you close any application use ADB , DDMS

首先确保您关闭任何使用 ADB 、 DDMS 的应用程序

like if you open Eclipse with android studio

就像你用 android studio 打开 Eclipse

Secondrestart your ADB from terminal

第二次从终端重启你的亚行

adb kill-server
adb start-server

if you cannt find terminal use this image to guide you

如果您找不到终端,请使用此图像来指导您

enter image description here

在此处输入图片说明

if this doesn't work with you close android studio and open it again

如果这对您不起作用,请关闭 android studio 并再次打开它

the cause of error , many application share ADB this why you cant start debugging

错误的原因,许多应用程序共享 ADB 这为什么你不能开始调试

回答by Priebe

Had similar problem in Android Studio (0.5.1) with SDK 18.0.1

使用 SDK 18.0.1 在 Android Studio (0.5.1) 中遇到类似问题

Warning: debug info can be unavailable. Please close other application using ADB: Monitor, DDMS, Eclipse

As you suggested updating the SDK worked. Now running on 19.0 and the problem got resolved.

正如您所建议的那样,更新 SDK 有效。现在在 19.0 上运行,问题得到解决。

回答by antroid

The same issues occured with me all of a sudden while debuging an app on my samsung galaxy S6

在我的三星 Galaxy S6 上调试应用程序时,我突然出现了同样的问题

This is what worked for me : closed android studio killed adb , using adb kill-server removed all of my previous breakpoints(debug points) Restarted android studio and my phone Restaterted Mac did a debug without any breakpoint. Then again did debug by putting the breakpoints again in my code, Eureka it worked. Luckily it burned only half hour of mine.

这对我有用:关闭 android studio 杀死了 adb ,使用 adb kill-server 删除了我以前的所有断点(调试点)重新启动了 android studio 和我的手机重新声明 Mac 进行了没有任何断点的调试。然后再次通过在我的代码中再次放置断点来进行调试,Eureka 它起作用了。幸运的是它只燃烧了我的半小时。

回答by Anubhav

A pretty straight forward solution is running the following commands in the command Terminal of Android Studio :

一个非常直接的解决方案是在 Android Studio 的命令终端中运行以下命令:

adb kill-server
adb start-server

and then try debugging again. It should be working now.

然后再次尝试调试。它现在应该可以工作了。

回答by Hitesh Bisht

You can restart ADB in windows without writing any commands.

您可以在 Windows 中重新启动 ADB,而无需编写任何命令。

Just open Task Manager

直接打开任务管理器

Sort the list by name

按名称对列表进行排序

Find process named "adb" enter image description hereRight click on it and then select "End Task" Done

找到名为“adb”的进程 在此处输入图片说明右键单击它,然后选择“结束任务”完成

Next time you run any app the adb will start with a new instance.

下次运行任何应用程序时,adb 将以一个新实例开始。

回答by saksham

This is a problem of ADB connections as sometimes ADB cache a dead connection on your real/virtual device and due to which the port is busy and u cannot connect to it.

这是 ADB 连接的问题,因为有时 ADB 会在您的真实/虚拟设备上缓存死连接,因此端口繁忙而您无法连接到它。

The simplest solution to this is RESTART your ANDROID phone that's it.

最简单的解决方案是重新启动您的 ANDROID 手机,就是这样。