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

I am trying to debug an app with Intellij 13.0 on Windows 7.
Whenever I start debugging I get the following warning:
Warning: debug info can be unavailable. Please close other application using 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.

For me this situation occured when device was connected via usb and adb tcpip was enabled (ADB in Wi-Fi mode).
Just run command adb usb with connected device and try to debug again.

Turn the USB Debugging on Device in Developer Options to off.
And then switch it back on.
This solved the issue in my case.
UPDATE
One more thing which fixed my case was clearing all existing breakpoints. And then trying to debug again.

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

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.

First make sure you close any application use ADB , DDMS
like if you open Eclipse with android studio
Second restart your ADB from terminal
adb kill-server
adb start-server
if you cannt find terminal use this image to guide you
if this doesn't work with you close android studio and open it again
the cause of error , many application share ADB this why you cant start debugging

Had similar problem in Android Studio (0.5.1) with SDK 18.0.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.

You can restart ADB in windows without writing any commands.
Just open Task Manager
Sort the list by name
Find process named "adb"
Right click on it and then select "End Task"
Done
Next time you run any app the adb will start with a new instance.

A pretty straight forward solution is running the following commands in the command Terminal of Android Studio :
adb kill-server
adb start-server
and then try debugging again. It should be working now.

The same issues occured with me all of a sudden while debuging an app on my samsung 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.

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.
The simplest solution to this is RESTART your ANDROID phone that's it.

Are you using adb through WiFi? That might cause debugging issues.
If so connect your mobile to your pc thru usb and debug again that should fix it.

This happened to me and the thing I did was to set
android:debuggable="true"
in <application> tag...like:
<application android:allowBackup="true"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:largeHeap="true"
android:icon="#drawable/icon"
android:debuggable="true"
>
This fixed the problem with later SDKs.

Below steps worked for me(If you are connected via USB debugging),
Go to the Developer options of the phone
Disable USB debugging and all other authorisations for USB debugging.
Enable back all
Now try to debug again, hope it will work.

Related

Android Studio - Unable to open debugger port: java.io.IOException

I am stuck in a problem here.
I cannot attach debug using Android Studio 3.5.1.
Its keeping showing me the message "Error running 'Android Debugger (8600)': Unable to open debugger port (localhost:8600): java.io.IOException"
I tried a lot of things like:
adb reset
invalidate
restart windows
reinstall android studio
and none of them works.
And I cannot find Enable ADB Integration on this version.
Anyone knows how to fix it?
EDIT
Debugging with emulator is working with all versions.
Debugging with devices is working only with devices with Android 9.0+
Kill and start adb didn't work.
I dont think its a local problem because its happen with a lot of people here. Its seems to be a project problem
You might check this 3 things:
1.
Youre not running a not debuggable version.
android:debuggable="false" in Android Manifest
2.
In Android studio you re not building a release version
Check in Build variants in bottom left corner.
3.
If nothing works use Troubleshoot device connections
Tools -> Connection Assistant
or older version
Tools -> Troubleshoot device connections
And try out the helper page from google (seems for older versions)
https://developer.android.com/studio/run/device#assistant
Try this:
adb kill-server
adb start-server
adb usb
For linux, e.g., ubuntu: start all commands with sudo like this:
sudo adb kill-server.
its your connection issue, cant find your device DNS.
what is your OS ?
In windows:
you must go to network and find duplicate dns and clear it (Search for
it)
In mac:
you must kill adb or delete that and run a new version
last hit is Update emulator in sdk
.First you need to check your build.gradle(app) file , and ensure that your build is debuggable.
.If debuggable then you need to check adb is working or not in your system, you can
check by just press 'adb' .
if its working then check devices by 'adb devices', it will show all connected devices.
add kill-server then enter and adb start-server
Try this. I have had luck with this approach when I run into problems with adb.
You can check if the device is recognised or not using
adb devices
If it is indeed recognised you may try to kill adb and start it again
add kill-server
adb start-server

Not able to debug app on android device - Android Studio 2.0

I am not able to debug an app on my device (Asus Zenphone 2) after I updated android studio to 2.0. I keep seeing below message in debug tab right after I click on debug icon in Android studio.
Message in debug tab in Android Studio UI
---------------------------------------------------------------
Waiting for application to come online: packagename
Waiting for application to come online: packagename
Waiting for application to come online: packagename
Waiting for application to come online: packagename
I keep seeing Alert Dialog with the title "Waiting for Debugger" and Force close button all the time.
I searched but it seems only two results from google for that message.
I restarted Android studio, checked developer settings on phone...
Have anyone faced with this issue. Please help me. I cannot run the emulator, because my mac will be too lag. Thank you in advance.
The problem is that after installing and starting to launch the app, that debugger client that AndroidStudio starts is unable to connect to the debugger server on the device. This can have many causes, see this answer and the other answer shown on this page and see if one solves the problem for you
To help figure out the problem, look at the 'Console' tab of the 'Debugger' window in AS. One of the first few lines should look like this:
$ adb shell am start -n "com.acme.audtest/com.acme.AudTest" -a
android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Cut and paste that line into a command prompt, REMOVE THE '-D', and execute it.
It your app ('AudTest') comes up without error, the problem is in AS, is communication to the device, or the configuration of the device. If the app doesn't start, it is in the .apk. (Not the complete solution, but starts to point you in the right direction -- for which of the solutions below applies to your situation.)
First I select the second option, and it worked fine. But then don't know why I change to select first option. So, the debugger shows the message Waiting for application to come online forever. And I did not notice that, just thought another app prevent me debug or that was an issue with Android Studio 2.0.
So, just check to second option will solve my issue. Thank all.
Restarting Android Studios (2.1.1) resolved this for me.
There are two possibilities:
1.USB Debugging off :
Start Developer Option of your devices
Switch On USB Debugging
2.In Android-Studio : File -> Invalidate Caches / Restart
anyone can be useful for you.Try it
The correct answer is close your Android Device Manager.
None of these suggestions worked for me till I closed it.
For me the problem was in "Android Studio" + "Intellij IDEA" running side-by-side. Was fixed by disabling bundled "Android plugin" in "Intellij IDEA".
(Note: problem appeared only with some later versions of these IDEs)
Nothing worked for me except one solution...
Clearing the Intellij IDEA (Android Studio) .idea directory which contains configuration information worked for me:
Exit Android Studio
Navigate to the project you are trying to debug
Backup any files inside .idea that you modified (if your project checks any of these into VCS)
Delete .idea directory
Open the project in Android Studio
I had to remove the parameter
android:exported = "false"
from the main activity.
if you get this problem on the emulator, running adb reconnect worked for me. there is a similar command for devices adb reconnect device
**
This answer might help for those Who have successfully connected their
device along netbeans NB Android but on debug there's no application
being appear on device.
**
Ok so solution is check your android device version in mobile setting click on about device at last: you will know your android version there.
Now choose the same version for your netbeans android project.
Right click on project name click on properties and then change target with same as your android device.
(In my case android version was 4.4.2 so I selected the same for my project target)
Before to go ahead click on service tab next to project tab in netbeans then right click on Android device and click on restart ADB.
Finally you need to right click on project again and click on clear and build.
Now you can run with hope to get result.
I just wanted to share my experience as I had the same error and there was no way to solve it using all the solutions you guys posted. I even deleted several times my virtual device, no way to make it work again.
In my App I have a custom permission com.example.CUSTOM_PERMISSION and I wanted to use it to protect my Main Activty from a confused deputy attack.
<permission android:name="com.example.CUSTOM_PERMISSION"
android:label="#string/permlab_deadlyActivity"
android:description="#string/permdesc_deadlyActivity"
android:permissionGroup="android.permission-group.COST_MONEY"
android:protectionLevel="dangerous" />
.
.
.
<activity
android:permission="com.example.CUSTOM_PERMISSION"
android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
Somehow that property android:permission was preventing my app to install and run on the virtual device, even though it could be compiled and build with Gradle successfully.
Just after removing it, everything is fine again
I am not sure the app is protected this way, I'm building another test app to try performing a confuse deputy and see if the declaration of the custom is just enough.
Hope this can help somebody that was getting mad like me!
I had this problem in the Android emulator, and it was solved by going to Tools->AVD Manager, selecting the device, right click "Cold Boot Now".
The solution which helped me is to click on attach the debugger to android Process and set debugger to java.
Just throwing my experience in as this just started happening. With regards to all these answers, I tried a few of them and none seemed to work. So I started from scratch:
Initial setup:
- USB Debugging ENABLED
- Always prompt when connecting to USB (I usually only connect in charge mode)
- Allow ADB debugging in charge only mode ENABLED
- Wait for debugger DISABLED
- Verify apps over USB ENABLED
The steps I took to get debugging back:
Close down Android Studio - I didn't go so far as to delete the .idea folder as discussed, but I'm sure it couldn't hurt.
DISABLE USB Debugging
Revoke USB debugging authorizations
Reconnect Device
$ adb devices
> <Device Id> unauthorized
ENABLED USB Debugging
Reconnect Device
When prompted select ALLOW (I clicked always allow)
$ adb devices
> <Device Id> device
Open Android Studio and hit debug - Application started successfully, I was still getting 5-6 of these messages but then it worked:
$ adb shell am start -n "com.exampleapp/com.exampleapp.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.exampleapp.test | com.exampleapp
Waiting for application to come online: com.exampleapp.test | com.exampleapp
Waiting for application to come online: com.exampleapp.test | com.exampleapp
Connecting to com.exampleapp
Connected to the target VM, address: 'localhost:8600', transport: 'socket'
React Native
As a side note - this happens every so often, I'm not sure whether it's from switching back and forth between running from react-native run-android or debugging in Android Studio, but regardless I've had to do this a couple times (finally decided to document).
Also remember
$ adb reverse tcp:8081 tcp:8081
and to start the packager when debugging (I tend to forget).
Try to restart ADB. Execute terminal commands:
adb kill-server
adb start-server
I had this problem and none of the solutions provided worked for me.
I you had the same issue, you can also try this:
Edit Run/Debug configurations
Select the 'app' or other name's configuration
At the launch Options, change Launch "Nothing" to "Default Activity".
Steps

How to resolve "Warning: debug info can be unavailable. Please close other application using ADB: Restart ADB integration and try again"

I am having a slight issue when trying to debug and android app via usb to external device. I keep getting the error "Warning: debug info can be unavailable. Please close other application using ADB: Monitor, DDMS, Eclipse
Restart ADB integration and try again
Waiting for process:"
I have tried stopping adb.exe in task manager , closing android studio and restarting , taking out the cable and putting it back and going to tools => android uncheck adb intergration then recheck it . All to no avail
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.
The simplest solution to this is RESTART your ANDROID phone that's it.
What worked for me was to disable and re-enable USB debugging on the device.
Following steps resolved this issue to me:
Disconnect the device.
Restart android studio.
Run the project.
Simply go to your Android phone developer settings, disable USB debugging, delete all authorizations for USB debugging and turn the debugging on again.
First make sure you close any application use ADB , DDMS
like if you open Eclipse with android studio
Second restart your ADB from terminal
adb kill-server
adb start-server
The issue occurs when I open the Android Studio and IDEA together.
Restart the Android Studio does NOT fix the issue
Re-plugin the cable either does NOT fix the issue
Restart the Mac either does NOT fix the issue
Restart the ADB from terminal FIX the issue
adb kill-server
adb start-server
In this way, you do not need to close the IDEA.
Updated: 2022-09-19
Restart the Android Studio does NOT fix the issue
Invalidate and Restart the Android Studio does NOT fix the issue
Re-plugin the cable either does NOT fix the issue
Restart the Mac either does NOT fix the issue
Restart the ADB from terminal either does NOT fix the issue
Restart the Android device fix the issue.
This problem sometimes occur when Android Studio is opened with another IntelliJ Editor. Just close the other IntelliJ Editor.
Open USB preferences in your device. Like the image below.
Click another option. (eg:File Transfer)
Click the no data transfer.
If it doesn't work,please try again.
The operations on the android devices are similar.
this may happen when you created two instances of android studio, or else you are using same device in multiple ADB programs, so simply disconnect you device and then open your desired android studio instance and then connect again. now it will work fine.
i also use same method and every time it works.
IntelliJ IDEA (Ultimate, probably also Community) comes with Android plugin. If IntelliJ is started and any project is open and has been compiled (even without any Android code-base) then IntelliJ (apparently) steals the adb-connection from Android Studio. Either close IntelliJ or disable the Android plugin in IntelliJ.
If IntelliJ is open with android plugin, rebooting phone, killing adb etc. are only sporadic and short-time fixes of the problem as IntelliJ steals the adb connection again.
I resolved this issue by changing the Use USB for settings
Go to setting select transfer settings in my case MIDI was selected.
Go to Airplane mode ON and OFF , After that everything back to normal.
In my case, I had my device connected both via WiFi (with adb tcpip) and USB cable. Disconnecting the USB cable solved the issue.
Quite awkward issue, I think none of the solutions mentioned above worked for me.
Ultimately, I had to invalidate caches and restart.
File -> Invalidate caches... -> Select both options -> Invalidate and restart
For me was Eclipse using DDMS and conflicting with Android Studio, I wasn't using, so I just uninstall it.
If is your case, go to Eclipse > Help > About Eclipse IDE > Installation Details > Select DDMS and Uninstall..
At times ADB caches a dead connection on device(real / virtual) due to which the port is busy and it is unable to establish a connection.
You can try different ways:
You can kill and restart the server:
adb kill-server
adb start-server
2). Try disconnecting the device(phone) and reconnecting it.
3). Restart your device (phone).
Slightly different answer, but I'm including it for completeness.
For me Android Studio had frozen as well with the spinning beach ball of death.
I rebooted the emulator (by having it emulate a power-off/restart cycle)
Killed Android Studio (on a Mac by using ⌘⌥esc)
Restarted Android Studio.
After that everything was back to normal.
if you open two Android Studio at the same time (android studio preview),Will be like this
A possible temporary work around that may work prove useful for progress sake when intending to debug is to run the app in android studio , then immediately click on run => attach to debugger

How to fix the error "Unable to open debugger port " in Android Studio?

Error running Android Debugger (8600):
Unable to open debugger port (localhost:8600):
java.net.SocketException "Connection reset"
I was able to fix this with these commands:
adb kill-server
adb start-server
Try Restarting ANDROID STUDIO (Worked for me)
In my case, there was another service running on my laptop(Windows) that was using the port 8600. I opened Task Manager and stopped the service. Now, I could debug my application normally without the above error.
I solve the problem by checking my localhost.
Making sure 127.0.0.1 localhost.
For me this problem started when i upgraded my Android Studio to new version.
Please go to options menu Build and choose Clean Project.
That is it project started to run again and error was gone.
I tried other answers (e.g. restarting Android Studio) but they didn't solve this for me.
I had accidentally selected MTP (Media Transfer Protocol) in my Developer Options/USB Configuration. It started working once I set it to PTP (Picture Transfer Protocol).
EDIT: On reflection it's probably just that I changed the protocol because I've had the same issue since while on PTP. Hence I'm suggesting that the real answer is to change the protocol on the phone and, if you might need it, don't forget to change it back.
It could be that you need to wait for your code to stop compiling before you attached the debugger. I had a similar error and all I needed was patience.
If you using WiFi debug:
Exit ANDROID STUDIO
adb kill-server && adb start-server
adb tcpip 5555
adb connect [your wi-fi IP]:5555
Start ANDROID STUDIO
I did spent quite an amount of time by trying below things:
Re-installing old(3.6.3) and new(4.0.1) Android studio and Android SDK's
checking all the security things in newly installed Mac OS Catalina
Checking all the developer options in my physical android device and AVD
And all the things mentioned in this post as well: https://medium.com/returntrue/android-studio-cant-bind-to-local-8600-for-debugger-%E3%81%A7%E3%83%87%E3%83%90%E3%83%83%E3%82%AC%E3%83%BC%E3%81%8C%E6%B0%B8%E4%B9%85%E3%81%AB%E8%B5%B7%E5%8B%95%E3%81%97%E3%81%AA%E3%81%84%E3%81%A8%E3%81%8D%E3%81%AB%E3%82%84%E3%81%A3%E3%81%9F%E3%81%93%E3%81%A8-8f5dd9c8ca70
Finally a small change in my /etc/host file resolved this issue. I commented from 0.0.0.0 and ::1 for localhost local DNS entries and enabled only 127.0.0.1

Warning: debug info can be unavailable. Please close other application using ADB: Monitor, DDMS, Eclipse . ANDROID STUDIO [duplicate]

I am trying to debug an app with Intellij 13.0 on Windows 7.
Whenever I start debugging I get the following warning:
Warning: debug info can be unavailable. Please close other application using 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.
For me this situation occured when device was connected via usb and adb tcpip was enabled (ADB in Wi-Fi mode).
Just run command adb usb with connected device and try to debug again.
Turn the USB Debugging on Device in Developer Options to off.
And then switch it back on.
This solved the issue in my case.
UPDATE
One more thing which fixed my case was clearing all existing breakpoints. And then trying to debug again.
I used adb kill-server in the console to get the Logcat to appear. Running Android Studio 1.02.
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.
First make sure you close any application use ADB , DDMS
like if you open Eclipse with android studio
Second restart your ADB from terminal
adb kill-server
adb start-server
if you cannt find terminal use this image to guide you
if this doesn't work with you close android studio and open it again
the cause of error , many application share ADB this why you cant start debugging
Had similar problem in Android Studio (0.5.1) with SDK 18.0.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.
You can restart ADB in windows without writing any commands.
Just open Task Manager
Sort the list by name
Find process named "adb"
Right click on it and then select "End Task"
Done
Next time you run any app the adb will start with a new instance.
A pretty straight forward solution is running the following commands in the command Terminal of Android Studio :
adb kill-server
adb start-server
and then try debugging again. It should be working now.
The same issues occured with me all of a sudden while debuging an app on my samsung 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.
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.
The simplest solution to this is RESTART your ANDROID phone that's it.
Are you using adb through WiFi? That might cause debugging issues.
If so connect your mobile to your pc thru usb and debug again that should fix it.
This happened to me and the thing I did was to set
android:debuggable="true"
in <application> tag...like:
<application android:allowBackup="true"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:largeHeap="true"
android:icon="#drawable/icon"
android:debuggable="true"
>
This fixed the problem with later SDKs.
Below steps worked for me(If you are connected via USB debugging),
Go to the Developer options of the phone
Disable USB debugging and all other authorisations for USB debugging.
Enable back all
Now try to debug again, hope it will work.

Categories

Resources