I've created simple "Hello, world!" project using android studio.
When I run it on the device or emulator - everything is fine.
Then I make attempt to run it in the debug mode - and it fails after a few minutes "waiting for debugger" dialog on the screen and
`Error running test-test: Unable to open debugger port : java.io.IOException`
message in event log.
How can I solve this problem?
Michael Yunusov this problem was on different machines the same time.
Solution: I had two IDEs running the same time: Android studio and
Eclipse. Closing one of them fixed the issue.
Try to reset your ADB.
To reset the ADB server:
Open Run-> Cmd-> adb kill-server
To start it again you can use:
Open Run-> Cmd-> adb devices
How it worked for me.
1. Start Android Device Monitor from Tools -> Android -> Android Device Monitor
2. Click on Stop for the process you are facing the issue from list of devices.
When i had this problem it was as a result of an invalid android manifest
Go to Setting > Developer Options > open Revoke USB debugging authorizations >choose OK
If you cannot find Developer Options: go to [Settings] > [About Phone], and tap [Version] for 7 times
Related
Got a new computer installed android studio. Created a test app (default) - No coding. I compiled and clicked the run and installed the app to the device (1+6). The app is installed but doesn't launch automatically.
I checked the configuration shows launch default activity.
What could be wrong?
Also another strange thing: I get emulator-5556 [OFFLINE] - blinking always in select deployment target.
Can someone help me fix this?
Thanks!
I had the same problem and was able to solve it. The problem seems to be the result of another program using the same port 5556.
In my case it was Videostream.Videostream tasks
After ending the tasks related to Videostream the blinking stopped and apps were deployed normally.
In such a case, you can do as follows
adb kill-server
adb reconnect
You should see online after above command & select this emulator from
- Run > Edit Configurations > Target
In General Tabarea choose
- Target: Emulator
- Android Virtual Device: <your emulator>
Check launch options from Run/Debug Configuration.
Lunch options > Launch > select as default Activity
Happy coding !!!
You need to select an emulator under Deployment Target Options -> Target:.
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
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.
When I run my app from AndroidStudio 0.4.3 using Run I see Choose Device which has two sections choose a running device or Launch Emulator. I don't have a running emulator at the moment so I click the ... to launch AVD manager and start an emulator. At this point I see that under choose a running device the emulator I just launched shows up but its listed as offline.
In the past the offline status went away when the emulator was fully up and running. However, now I've noticed that when the emulator is launched fully, it no longer appears in choose a running device.
I feel like I'm always playing cat and mouse game with android studio picking up the emulator. Is there a better way to do this? Am I missing something?
Disable and then Enable ADB Integration
In Android Studio go to
Menu -> Tools
Android
Enable ADB Integration (should be checked, click to remove check)
Enable ADB Integration (should not be checked, click to add check)
Run your app again. Emulator that was previously missing from Run dialog should be available to be selected upon which to run your app.
Try to kill the adb server and restart it.
Locate your adb binary (linux/osx) or adb.exe (windows) and do:
adb kill-server
adb start-server
this should fix your problem
Even if your problem still not solved then Restart emulator.
Wipe Data and restarting emulator helped me, hope this helps to someone.
inside AVD manager, select your virtual devices, then 1 stop, 2 wipe user data, 3 cold reboot, works for me.
On Windows, running Android Studio with administrator permissions can help (in addition to restarting adb server).
Unchecking the "Enable ADB " worked for me
In Android Studio Arctic Fox (2020.3.1) it helped me to cold boot the device.
add -port 5037 on ../[some_emulator]/emu-launch-params.txt file & try again...
like image
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.