I am using Android Studio to develop my apps.
Since I upgraded my HTC One M8 to Lollipop, I can not use it to test my apps by "Run app" in Android Studio.
I get this error and nothing happens on my phone:
Launching application: com.project.GalleryActivity.
DEVICE SHELL COMMAND: am start -n "com.project.GalleryActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String android.os.SystemProperties.native_get(java.lang.String) (tried Java_android_os_SystemProperties_native_1get and Java_android_os_SystemProperties_native_1get__Ljava_lang_String_2)
at android.os.SystemProperties.native_get(Native Method)
at android.os.SystemProperties.get(SystemProperties.java)
at com.htc.customization.HtcCustomizationManager.<init>(HtcCustomizationManager.java)
at com.htc.customization.HtcCustomizationManager.<clinit>(HtcCustomizationManager.java)
at android.os.Environment$UserEnvironment.getCustomizationReader(Environment.java)
at android.os.Environment$UserEnvironment.isDynamicSwitchSupported(Environment.java)
at android.os.Environment$UserEnvironment.<init>(Environment.java)
at android.os.Environment.initForCurrentUser(Environment.java)
at android.os.Environment.<clinit>(Environment.java)
at android.os.Environment.getLegacyExternalStorageDirectory(Environment.java)
at android.os.Debug.<clinit>(Debug.java)
at android.ddm.DdmHandleHello.handleHELO(DdmHandleHello.java)
at android.ddm.DdmHandleHello.handleChunk(DdmHandleHello.java)
at org.apache.harmony.dalvik.ddmc.DdmServer.dispatch(DdmServer.java)
java.lang.UnsatisfiedLinkError: android.os.Debug
at android.ddm.DdmHandleHello.handleFEAT(DdmHandleHello.java)
at android.ddm.DdmHandleHello.handleChunk(DdmHandleHello.java)
at org.apache.harmony.dalvik.ddmc.DdmServer.dispatch(DdmServer.java)
java.lang.UnsatisfiedLinkError: android.os.Debug
at android.ddm.DdmHandleProfiling.handleMPRQ(DdmHandleProfiling.java)
at android.ddm.DdmHandleProfiling.handleChunk(DdmHandleProfiling.java)
at org.apache.harmony.dalvik.ddmc.DdmServer.dispatch(DdmServer.java)
Aborted
My project's settings are these:
This technique used to work perfectly before upgrading and I have not change anything since that time.
I was facing the same error on Asus Zenfone 5 (ASUS_T00J) with Android 5.0. For me the solution was to switch off the "Verify Apps over USB" in the "Developer Options".
Launcher may not be the issue since I tried with Google Now Launcher as well without success. It was working fine on my Nexus 5 with Android 5.1
Workaround: disable ADB integration in Android Studio.
Tools > Android > uncheck Enable ADB integration
I'm not sure what the underlying cause is, but I found I could successfully avoid this issue by closing down all running apps on the phone before trying to Run my code on my M8.
Do you use any third-party launcher on device? I have same issue when use Aviate launcher. I switch back to BlinkFeed in Personalize->Main Screen settings and my deploy to device is stable now.
Classpath com.htc.customization.HtcCustomizationManager make me thing than this issue related to launcher.
I met the same problem on ASUS ME176C(Lollipop 5.0),
but I resolved it by setting "Select debug app" to "No". Then push apk as usual. After that, you can reselect "debug app" to target app.
I discovered a "workaround" to solve this problem
Find the HTC Blink Home Launcher and uninstall the update
(CAUTION:uninstall the launcher update will remove all icons and widgets placed on the launcher)
This works for me and it can be used debugging now without removing the apps in multitask.
This should be a bug caused by HTC?
(I am using HTC Butterfly 2 & Android 5.0.2)
I don't have the rep for commenting but i was in the same situation of #user47625 but my "Verify Apps over USB" was already off. I've tried to enlarge a bit this answer with some reasoning.
At first I've tried to change the launcher and I got some luck but was hit and miss, not a proper solution. Rebooting the phone granted a couple of hours of calm work.
Then i've found someone on google that stated:
If it is that bug: The DDMS client connects with a "Hello" when the PM process first starts and registers itself, but before it has fully initialized all the native code. It is a race in stock Android and occurs there too
So if this race occurs it doesn't occurs everytime, but every now and then, I suspect something regarding interaction of item on Android. I don't know if it's CPU, RAM or App related, but on my Zenfone 2 closing all background apps (1) and releasing the memory (2) does the trick, letting me able to debug the app properly.
I used Clean Master cause is stock with Zenfone 2, but i suspect every memory manager can do that. Give it a try
On my HTC M8, I resolved the issue by disabling "Settings -> Developer options -> Use NuPlayer(experimental)"
What I have noticed is, when I try to run the application I created long back (few years ago), I have to disable the NuPlayer. However, with new applications, I must keep the option checked.
Hope this helps....
On an Asus ZenPad, 5.0.2 I was able to solve the issue by going into Asus' Auto-start Manager (Settings -> Power management -> Auto-start Manager) and allowing my app to auto-start.
I've had a reasonable amount of success with the workaround below.
After each debugging session with your app, go to the Android Studio terminal:
> adb shell am force-stop com.your.app.package
I still occasionally get the java.lang.UnsatisfiedLinkError but only following the above command rather than in between the build/push apk/install process and attempting a debugging session.
To me, this saves a lot of wasted time building only to get the error. If the command above doesn't work, just up-arrow and re-run the command until it works without an error.
This solution worked for me, you may give it a try.
Add adb path to System Environment Variables (I'm using windows 8)
Ex: my path is "C:\Users\xxx\AppData\Local\Android\sdk\platform-tools"
Dont forget to reboot your system to take the effect!
About how to set the path and environment variables in Windows >> here
Related
on android 6.0.1 I am getting this error when trying to use run-as.
⋊> ~ adb shell 14:29:01
shell#trlte:/ $ run-as org.ligi.passandroid
run-as: Could not set capabilities: Operation not permitted
I really like the run-as command - is there a way to get it to work on 6.0.1 ?
If you have a SAMSUNG device, don't bother - SAMSUNG broke run-as by dropping the setuid flag (so run-as has no chance of switching to a different identity).
Also don't bother trying the Smart Switch "reinitialize device" workaround, it won't work until SAMSUNG fixes it in the firmware (so it is worth updating to the latest version).
Use some other method to access your app's data, like adb backup:
adb backup -f data.ab <my.package>
dd if=data.ab bs=24 skip=1 | openssl zlib -d > data.tar
Instead of dd you can use the abe tool, which can also write .ab files.
For me, it went like this. I am using Samsung s6 API 24. The error list log's detail was the same as mentioned in the question. But when I checked the Build Logs I found the solution written there. To set the MSBuild. So I followed the following steps to resolve this and the app ran successfully.
To correct this problem I had to
Unload Android Project from solution explorer
Right-Click unloaded project and "Edit Project File"
Searched code for "EmbedAssembliesIntoApk"
Found the occurrence in the project file
<EmbedAssembliesIntoApk>false</EmbedAssembliesIntoApk>
Change it to true and reload the project.
<EmbedAssembliesIntoApk>true</EmbedAssembliesIntoApk>
Ran the app and the app starts running on Samsung s6
The solution for me was the parameter -autolaunch in the Debugger configuration of the project in the field Parameters.
I use Delphi 10.2 with S7 Edge Android 7
Unlike another answer here, I have also tried to use smart switch & hard device resetting, but unfortunately that approach did not work for me (Wasted extra one hour just to try out that approach). Besides not working, it might create additional problem "samsung account: session expired" - problem, which can be fixed only if you have root access to your device.
I by myself have used instructions from here:
https://www.youtube.com/watch?v=Sy4FWLHxGYs
and then from here:
https://www.tomsguide.com/us/samsung-galaxy-s6-guide,review-2856-3.html
for getting root access to your device, and after that run-as can be executed with additional command "su -c" as for get root user. So whole command will look like this:
su -c run-as org.ligi.passandroid
WARNING: Gaining root access to your device will most probably void your device warranty if you have any left.
Additionally to this, I wanted to be able to debug my application inside Samsung Galaxy S6, so I've altered Visual studio components, more instructions can be found here:
https://issuetracker.google.com/issues/37093233#comment53
If you happen to have Samsung based android device - I have already reported that bug to Samsung, but I've could not get any time schedule if when and if at all they are going to fix this issue. If you own some other Android device - makes sense to report this problem to manufacturer.
I was working from Delphi 10.1 berlin.
I was presented with the same problem and my solution was to configure the sdk to the previous version.
I was using Android SDK 25.2.5.32bit and downgraded to android SDK 24.3.3 32 bit. To configure:
Tools->Environment Options -> SDK Manager
Then, add the necessary sdk, in this case android SDK 24.3.3 32 bit.
#RustyX answer helped my partially. zlib didn't work in my Mac. So I had to use the Android Backup Extractor to convert .ab file to .tar file. You can download it here.
For the full step by step instruction, refer here.
In Visual Studio, App properties, Android Options, changing the debugger from C++ to .Net(Xamarin) seems to have fixed the problem for a mixed C++/C# app.
Also got this error today when I tried to deploy/debug my application on a Samsung Xcover 3 running Android 6.
I solved it by changing the project property "Android Options / Use Fast Deployment" to false.
Here is solution for MS Visual Studio 2022.
https://www.youtube.com/watch?v=_r9GLm0k55o
Just uncheck the "Use Fast Deployment".
I had previously posted an answer here which was deleted, maybe because it was a link to another stackoverflow question referring to the answer I gave there, instead of containing the full answer.
Reposting its contents here from https://stackoverflow.com/a/43242739/7823460:
I had a very similar issue on Samsung Galaxy S6 Edge, trying to start debugging on VS2015, I got a different error, much less verbose than in the attached screenshot:
run-as: Could not set capabilities: Operation not permitted
Based on the contents of the attached screenshot above, I tried 'initializing' / factory resetting the device using Samsung's Smart Switch and it actually fixed the 'run-as' issue I was having.
This is the only solution which worked and didn't involve rooting the device, so I believe it must be publicly available. Of course people attempting this should keep in mind that factory reset means that data will be lost, unless it's backed up. The same Samsung software helps with backing up your data.
I’ve recently upgraded one of my Android devices to Android Lollipop (5.0) and now I can’t debug my application and even install apk on the device using adb. I receive the following error
java.lang.UnsatisfiedLinkError: No implementation found for java.lang.String android.os.SystemProperties.native_get(java.lang.St
ring, java.lang.String) (tried Java_android_os_SystemProperties_native_1get and Java_android_os_SystemProperties_native_1get__Lj
ava_lang_String_2Ljava_lang_String_2)
at android.os.SystemProperties.native_get(Native Method)
at android.os.SystemProperties.get(SystemProperties.java:64)
at android.os.Environment.<clinit>(Environment.java:354)
at android.os.Environment.getLegacyExternalStorageDirectory(Environment.java:488)
at android.os.Debug.<clinit>(Debug.java:96)
at android.ddm.DdmHandleHello.handleHELO(DdmHandleHello.java:164)
at android.ddm.DdmHandleHello.handleChunk(DdmHandleHello.java:91)
at org.apache.harmony.dalvik.ddmc.DdmServer.dispatch(DdmServer.java:171)
java.lang.UnsatisfiedLinkError: android.os.Debug
at android.ddm.DdmHandleHello.handleFEAT(DdmHandleHello.java:176)
at android.ddm.DdmHandleHello.handleChunk(DdmHandleHello.java:93)
at org.apache.harmony.dalvik.ddmc.DdmServer.dispatch(DdmServer.java:171)
java.lang.UnsatisfiedLinkError: android.os.Debug
at android.ddm.DdmHandleProfiling.handleMPRQ(DdmHandleProfiling.java:187)
at android.ddm.DdmHandleProfiling.handleChunk(DdmHandleProfiling.java:88)
at org.apache.harmony.dalvik.ddmc.DdmServer.dispatch(DdmServer.java:171)
My device is Asus FonePad 7 ME175CG or K00Z
Kernel version
3.10.20-i386_cpt
android#mec9#1
Mon Apr 20 13:30:08 CST 2015
Is there any solution for this problem?
UPDATED
first of all thanks to those guys who pay attention to this very specific question, really thanks
for further clarification,
When I received this error, I googled the entire universe for the phrase java.lang.UnsatisfiedLinkError and gave a try to any solutions that seemed to be applicable, as well as, the solution that suggested by #Kushal and others. Most of the questions were (and still are) for HTC M8 and devices other than ASUS. If you visit this post, you may see an answer by me which is deleted by SO guards and I admit it that it was not really an answer and I post the answer while I was really disappointed of resolving the issue.
Anyway, what I've done up to now which may be helpful for others are,
First, I upgraded my Android SDK tools to the latest version 24.2. After that when I tried adb install demo.apk, in some cases it was successful and sometimes not. I killed all running apps on the device (as suggested by some guys) but it sometimes works and sometimes not.
Then, I gave a try to other solution, specifically the one that suggested by this post. In fact, when I try to debug the app using Intellij IDEA, the IDE itself does as the suggested procedure and the result is
You can see that the IDE itself does as the procedure by #Kushal suggests.
After that, I found several records (referring a few as) here and here and in latter someone has said that
This was a bug in some HTC devices that was fixed with L-MR1
Therefore I came up with the idea that there may be a fix by ASUS team which you guys know about it and kindly provide me with that.
Thanks
Disabling Tools -> Android -> Enable ADB Integration solved my issue.
Running on Asus Zenfone 2.
I don't know why this issue appears but you can successfully avoid this issue by closing all the running applications on your device.
Also Unable to test app after upgrading to Lollipop
This error message is due to release binary problem by manufecturer (Asus in this case). This error will not appear in Google Nexus and Samsung Galaxy due to their handling in binary
Solution :
After searching about above problem, the below solution is found on other Stack Overflow question :
Using terminal, just reinstall with adb to avoid the Android Studio recompile time:
$terminal: /sdk/platform-tools/adb install -r
And usually it works. If it fails again, just run this command again
If you really want to try it, the process would be:
Close Studio (or try disabling Tools | Android | Enable ADB Integration)
Do the following on a shell:
$ adb push /path/to/your/project/app/build/outputs/apk/app-debug.apk /data
$ adb shell pm install /data/app-debug.apk
$ (am start command from comment #4/#5)
Restart IDE (or Re-enable ADB Integration).
This solution is suggested by Google group for alternate fix to above problem Here
Reference Answer : Here
This way you will able to re-install apk and above error will not come
I found a solution though I am not sure if others are willing to use it as it may harm the device and causes it to get useless
In fact, as the answers that the question has received just sound to be copy and paste of other questions’ answers and are not applicable in my case I disappointingly tried to make a radical move and flash my device to downgrade its software to Android 4.2.2 but chancy I decided to flash my device to Android Lollipop again to see if it removes the issue and fluky it did (at least in my case)!
IMPORTANT NOTE!
Before following this procedure, consider the fact that your device may get broken and you lose all data you have on your device. So please make a backup copy before you proceed.
I searched a lot and found methods that are partially described here and here but finally I followed this procedure:
Download the correct update file from here (ASUS support or FonePad Support) according to the type of your device (ww, tw or others). Mine is ww and downloaded ASUS Fonepad 7 (ME175CG) Software Image Version: WW_V6.3.7 For WW.
Then change the downloaded file to ASUS_BUNDEL.ZIP
Then copy that file in to root internal memory
Putting the device into recovery mode (by holding volume up and
power key down simultaneously)
Choose SD Download
The device starts to flash and after finishing it you have a brand new device and the issue is completely removed.
Now I can install apk using adb command and debugging my application as I did before and I have not seen the nasty error anymore.
I'll open this answer to receive others feedback then I mark it as the real answer.
I hope this help others resolve the issue.
I had the same issue with Asus MemoPad ME70CX and solved by restarting ADB server using command line. Also you may need to kill BlueStacks processes running in background using TaskManager.
UPDATE
The supposed duplicate is a question on being stucking in "Waiting For Debugger" when executing Run, while this question is on being stucking in "Waiting For Debugger" when executing Debug, the steps to produce the problem is different, and the solution(s) are different as well.
Whenever I try to use Android Studio's Debug function, the Run status would always stuck at:
Launching application: com.astrotek.parashoot.debug/com.astrotek.ptpviewer.StarterActivity.
DEVICE SHELL COMMAND: am start -n "com.astrotek.parashoot.debug/com.astrotek.ptpviewer.StarterActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.astrotek.parashoot.debug/com.astrotek.ptpviewer.StarterActivity }
While the device (Samsung Galaxy S3 Android 4.3) I'm debugging would display
This has being the case from Android Studio 0.8.8 all the way to 1.0. And on the same computer I can perform debugging using Eclipse on the same device without any issues.
So the question is what can I do to make Android Studio debugging work?
Update: The same thing happens when debugging on Nexus 7 (2013) running Android 5.0; and testing on another machine rendered the same result. I can't be the only one encountering this issue :-/
Update: Opened a bounty since this issue is so annoying. Even re-installing the app doesn't solve. Nexus 5 running Cyano, Win7 64. The ADB log is telling:
8568-8568/it.myapp:myprocess W/ActivityThread﹕ Application it.myapp is waiting for the debugger on port 8100...
8568-8568/it.myapp:myprocess I/System.out﹕ Sending WAIT chunk
Also, I can't find an easy way to disconnect nor reset ADB connection in Android Studio.
Obviously is yet another Android Studio, or rather ADB bug.
Just use this command to disable it.
adb shell am clear-debug-app
OR
Ensure there is nothing to wait for, by automatic uninstall from Device before each test-run, using Gradle's uninstallAll task, as mentioned in:
stackoverflow.com/Auto uninstall before install?
On some machines/projects the debugger do not attach automatically so you need to attach it manually (studio menu -> Run -> Attach debugger to Android process)
Restarting Testing device fix the issue for me.
Restarting Android Studio fix the issue for me.
After clicking on the run icon. If it is stuck waiting for a debugger means it is not attached to the app. You have to manually attach by clicking on Attach Debugger to Android process.
It is on the right side of the run icon. I had focus this icon in linked image.
Updated Image for Attach Debugger to Android process Icon
Debugger stopped connecting for me today and nothing worked until I tried the following:
Go to Run, Edit-Configurations, Miscellaneous Tab, uncheck 'skip installation if APK has not changed' Apply, OK.
Debugger started to connect again.
A similar question has been asked recently and the solution may work for some and is very quick.
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
This problem occurs when you open more than one instance of Android studio, so you need to attach the debugger manually like mentioned above.
You may need to close other instances of Android studio.
I faced this problem in android studio 3.0. Just restarted device solved.
Both of my dev machines have JDK 8 installed, the debugging function is restored once JDK 7.0.71 was installed and JAVA_HOME environmental variable was set to point to the new JDK.
Guess there's some compatibility issue between Android Studio + ADB + JDK8 (Eclipse + ADB + JDK8 works fine).
I tried the top three rated answers but failed. After rebooting my mobile, the problem is solved. No more long "Waiting for Debugger".
I just managed this problem, after several days of trying the above solutions.
So I closed the emulator, run AVD manager and in device menu choose - "wipe data"
So in next run I was free from stucked debugger.
When the Device displays the message go to Run->Attach debbuger, then select a debbuger. it'll start the activity.
This fixed it for me. Android Studio -> File -> Invalidate Caches & Restart...
I had the same problem. Restart my android phone device worked for me.
This solution works for me:
turning off the USB debugging from my device settings , and then turning it on again.
its Much quicker and easier than restart the device.
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.
For me, the issue was: The Regional Format of Windows was ARABIC.
I simply changed the regional format to English (United States) and the error has fixed.
Steps to fix:
Go to Start -> type Region -> click on Region to open Region window -> from the Format dropdown, select English (United Stated) -> Click OK.
Restart Android Studio.
As for my case, running Android Studio Canary (preview release) along with the stable version was the problem. Running multiple instances of the same Android Studio flavor was OK, but mixing them often resulted in "Waiting For Debugger".
Most of the times this is caused because of the overload of resources and threads over the emulator. Or even for the lock of objects that GC couldn't set free: http://developer.android.com/intl/pt-br/tools/debugging/index.html
Usually, a single restart of it will solve the issue, but sometimes it asks for the IDE restart, so be sure to make both tests.
Another good test is trying to start the app in "Start mode" and then try the debug mode again...
P.S: Don't forget to kill each debug process in the IDE after each test. This will prevent your env to be more overloaded.
Android studio 3.0 and Above
Disable the instant Run
This also happens to me from time to time. Problem is that your app / device is configured to wait for debugger. In this case it is waiting for debugger before continuing execution of.
Option 1:
Attach debugger or run in debug mode. You can do this in Android Studio. Buttons to attach debugger and run in debug mode are located next to normal run mode (Bug and Bug with arrow).
Option 2:
Disable Wait for debugger. You can do this is developer settings. This option needs to be disabled in:
Root of Developer Options
Developer options -> Select debug app ->
-> Wait for debugger
This was tested on Android emulator in android studio. Other phones might have this setting different. If you can not find app's settings in debug, reinstalling app might work too.
I had the same problem. Restart my android device and closed the adb.exe process. With that I could solve the problem
Well, I guess there is a plethora of circumstances that can trigger this issue. I'm using IntelliJ Idea instead, but it's mostly the same than Android Studio. My solution for this problem:
Fastest way:
Right click on the class file that contains the main activity of your
project, and then on "Debug 'WhateverActivity'". This will create a
new run configuration that should debug fine.
Other solution, without creating a new run configuration:
Open Run/Debug configurations and within "Android app" pick the configuration you're using to debug your app.
Locate "Launch Options/Launch" there and set it to "Specified Activity" instead of "Default Activity".
In the "Launch" field just below the aforementioned option, click on the three ellipsis (three dots) button and select your main
activity.
At least it worked for me. I hope it works for others too.
Got it fixed according this solution: https://youtrack.jetbrains.com/issue/IDEA-166153
I opened <project dir>/.idea/workspace.xml replaced all the
<option name="DEBUGGER_TYPE" value="Auto" /> occurrences to
<option name="DEBUGGER_TYPE" value="Java" />
and restarted Android Studio
Open Command prompt and go to android sdk>platform-tools> adb kill-server
press enter
and again adb start-server
press enter
Non of this solutions worked for me.
In my case was that I was debugging an App from Intellij IDEA and at the same time with Android Studio. By just closing the Intellij IDEA and removing the app I was debugging just fixed my problem.
Make sure that your Active Build Variant is debug.
If you also want to make your release variant APK debuggable then make a simple change in app level build.gradle -
buildTypes {
release {
debuggable true
/*Your rest code*/
}
}
For me the problem was having IntelliJ open at the same time as Android Studio. I was using IntelliJ for back-end development at the same time as Android Studio for app development. Even though I was not doing any mobile device work with IntelliJ, it broke debugging in Android Studio.
Solution: Shutdown IntelliJ when debugging with Android Studio.
Restarting everything didn't work for me. What DID work was waiting for a few minutes while Android Studio unclogged itself. This was the first time I ran the debugger; after that, Android Studio fired up the debugger quickly.
When I try to debug using android device in android studio Logcat shows nothing. But when I use emulator LogCat shows all the messages. How should view the Logcat messages when debugging on actual device?
Thank You !
In Android studio 0.8.0 you should enable ADB integration through Tools -> Android, before run your app. Then the log cat will work correctly. Notice that if you make ADB integration disabled while your app is running and again make it enable, then the log cat dosen't show anything unless you rebuild your project.
Restart the phone. And it solves magically
I was using Lenovo A7000plus powered by Android 6.0 M and found out that my Android Studio was unable to record the debug process, but somehow other's phone debug report could be recorded. Plus, I tried use Memu emulator and it recorded normally.
Strangely, that device was recognized by Android Studio and ready to be debugged, but no recorded debug report at all from all application that ran on the device. Of course, USB debug was tuned on.
What I did before, I turned off Developer option on that phone in order to play my favourite mobile game (F/GO) which forbids USB Debugging is turned on in the device.
A few hours later, after trying any method in Internet and not success, accidentally I found simple but strange solution that is Restart the phone. I restarted the phone while it was connecting to PC, and somehow the logcat showed all debug process in Logcat like normal.
It sounds like non-engineering solution at all, but that's really work for my case.
As of 0.4.0 I have noticed that the logcat tab does not work in the debugger window - only in the Android DDMS window (hit Alt+6 to bring up the working logcat while debugging). Awkward I know :)
In Android studio 1.0.2 or later: you should enable ADB integration through Tools -> Android, before run your app
In Android studio 1.* if logcat messages have disappeared for me helps the next trick:
Tools -> Android -> disable )) "enable ADB integration" (if it've been enabled)
Tools -> Android -> enable it again "enable ADB integration"
In 0.8.2 the DDMS window doesn't show up. However restarting the adb logcat windows by pressing Alt+6 (Twice, if it's already opened) fixes the issue. It worked for me.
I understand that this question is over 2 years old, but from my searches a few people are still having a persistent problem with this. One possible solution to this (which worked for me after two hours!) is that your phone settings may have its "Log Switch" set to off, hence it isn't sending your log data to the IDE.
Here is the solution - "Unable to open log device '/dev/log/main': No such file or directory"
Hope it helps!
If anyone's still having trouble with this despite trying all the answers here, just use System.out.println instead of log.* and your debug messages will output.
Updated: I finally got the cause of the problem in my case. If I switch of my device's wifi, the log shows. Otherwise, the log will not show. I tried several times and it the always show full logs when I turn off my wifi.
My device is: Gsmart Classic, OS: Android OS, v5.1 (Lollipop). I met the problem when I updated the gradle build tool from 'com.android.tools.build:gradle:2.0.0-alpha1' to 'com.android.tools.build:gradle:2.0.0-alpha3' in Android Studio 2.0-preview. After trying all the solutions with no luck, I tried un applied all the instant run choices and re-apply it again. Then the logs show up.
Note: if it still doesn't help. You can as well try to switch back-and-forth the back ground process limit. Unfortunately, I couldn't reproduce the error.
In Android Studio 2.x I used to have to restart to get it working but often switching back and forth between the applications works or running
adb kill-server;
adb start-server;
to restart adb fixes many things as well.
The problem seems to have different causes.
For me, the issue was that I had two emulators with the same name (I created it, deleted it, and then created it again with the same name). There were two emulator entries in the logcat dropdown and it was connected to the wrong one. All I had to do was switch to the other one. I prevented the problem permanently by renaming the emulator.
I believe that the problem has various causes for different users. I experienced the same issue with logcat not displaying any information when my application crashed, and we all know how frustrating this can be.
The following are the solutions that worked for me.
Invalidating caches and restarting android studio
In the developer option in your physical device make sure the logger Buffer size is set to 1MB per logger buffer.
Restart your physical device.
Hope this helps.
I have HTC Comet connected to Eclipse with SDK 2.2. I do a debug build - the application does not run; though it does get installed on the device. On the device I get this message box on the Comet screen
Waiting for Debugger
Application HunyDew (process com.airvine.hunydew) is waiting for the debugger to attach.
[Force Close]
Whereas in the Eclipse console I get these set of messages
[2010-12-07 01:42:29 - hunydewprj] Android Launch!
[2010-12-07 01:42:29 - hunydewprj] adb is running normally.
[2010-12-07 01:42:29 - hunydewprj] Performing com.airvine.hunydew.HunyDewAAStartsHere activity launch
[2010-12-07 01:42:47 - hunydewprj] Application already deployed. No need to reinstall.
[2010-12-07 01:42:47 - hunydewprj] Starting activity com.airvine.hunydew.HunyDewAAStartsHere on device 308730C861BC
[2010-12-07 01:42:49 - hunydewprj] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.airvine.hunydew/.HunyDewAAStartsHere }
[2010-12-07 01:42:49 - hunydewprj] Attempting to connect debugger to 'com.airvine.hunydew' on port 8601
[2010-12-07 01:43:09 - hunydewprj] Launch error: Failed to connect to remote VM. Connection timed out.
The application runs fine in the Emulator - please help - what is it that I am missing here? Any hints/suggestions? Thanks
Some devices will only let the debugger attach if the application has the android.permission.SET_DEBUG_APP permission set in its manifest file:
<manifest>
<uses-permission android:name="android.permission.SET_DEBUG_APP"></uses-permission>
</manifest>
The Dialog Waiting for Debugger is shown if you are building a debug application or somewhere in your source code, you called Debug.waitingForDebugger();
Inside Android Studio 2.0 and above, there is an option of Attach Debugger to Android Process. It is the last menu item in the Run menu.
Not sure if this is what you are looking for, but try putting:
android:debuggable="true"
in the application tag in the AndroidManifest.xml
I've got this problem for long that I cant get my android emulator or device connect to the debugger while both the console and the emulator were displaying waiting for connecting to the debugger.
And configuration for debug inside eclipse also confused me so much before, but today, i got this problem solved, by the following steps:
When you want to debug a android project, for instance, mypro. you would right click on it in the "Package Explorer". Then choose "Debug as"-->"Android Application".
Then the emulator might stop at the "Waiting for connecting to debugger"(or something else similar to this).
Then you need to connect to the debugger yourself by click "DDMS" to open the DDMS perspective, and click "Devices" tab.
Then you can see a list of processes that are running on your emulator or device.
Double click on the one which you are debugging, then change to the Debug perspective, you can see the debugger is connected and you could debug your program. That's how I solved this problem.
By the way, my OS is Win7 32-bit. Eclipse's version is Helios Service Release 2. Android SDK is rev. 16 and platform-tools' 10.
Update.
I found that it is the problem of my TCP/IP configuration. The debugger can't be connected when i assign a static IP address(for access to internet).
So every time when the debugger is unable to connect, I always do the following steps:
1.close current eclipse window.
2.change the config of IP address to dynamic, it means getting a IP address by DHCP.
3.open up the eclipse again.
then the debugger is able to be connected. I thought it might be a issue of the internal mechanism of java debugger which is using socket connection.
I get this if I switch the usb cable to a difference port on my PC, odd but it works when I switch it back again. Also I think I've got this when there's been another device or emulator running at the same time, or two instances of Eclipse open.
For those getting this annoying behavior in 4.2.2 you have to un-check the setting for "wait for debugger" in the developer options. Of course, those options were hidden by Google, and you have to do a sneaky trick to get them to show back up. I had set them before they disappeared, and couldn't for the life of me find them again.
This page explains the procedure
Running Android Studio, I ran into this problem and after trying various remedies restarting Android Studio is what appeared to fix the problem.
My solution is to use the Dalvik Debug Monitor. Sometimes there is a red or green bug beside a process. Click on the device you're trying to load to. Select the Actions tab and reset adb. This usually attaches the debugger for me. I find that doing debugging through this Monitor works better for me than using the Android Eclipse plugin Logcat.
Closing the emulator and closing eclipse. Reopening Eclipse and starting the simulator worked for me.
The key thing to look for is in the Devices pane of Eclipse. If you start the emulator or device and it shows up in the device name list but says [null] and no running processes show beneath it, then it won't work correctly with loading your app into it.
If the name of the device comes up and is Online then things seem to work smoothly.
Don't know why it doesn't work out all the time though.
In my case, the problem is caused by adb connected with another device.
If several devices are connected in PC, remove other devices except required one.
I end up going into "Debug" perspective.
Then in the "Debug" frame, there are debug list or running list.
You have to decide which one is your current one that has this problem (Waiting
for debug...)
Then do right-click and choose "Terminate and Remove".
Then you try to run again. And that warning box will be gone.
I solved this issue this way:
Go to Run menu ====> click on Edit Configurations ====> Micellaneous and finaly uncheck the option Skip installation if APK has not changed
Rebooting the phone was the solution for me.
If your development environment is Windows make sure the USB drivers are correctly installed.
One way to ensure that the USB drivers are installed correctly is to get the PDANet Windows installer and let it install the USB drivers.
You can find the PDANet page here.
I would try to connect to the phone with ddms on its own without Eclipse. You might be running an emulator inside eclipse that you dont see or have some other problems with Eclipse.
Just run ddms from a command prompt and see if the device appears and you can connect to it.
You can also see if appears when you run adb devices and see that your phone is listed (and maybve something else..)
I got the same problem, I know I wasn't running any other instances, and I could see it with adb devices. I just did a restart of eclipse and it worked.
Rebooting the PC was the only thing that worked for me. It worked when I had this problem with an Android 2.2 phone, and also an Android 3.1 tablet.
I ran into this problem today. After spending most of the day trying to fix it, the only thing that ended up working was to create a new workspace and import my project into it. I hope this helps someone avoid all the trouble that I went through.
I also enounter this problem. In my environment, I use a tomcat as server and android as client. I found,
If tomcat is started, this error " Launch error: Failed to connect to remote VM. Connection timed out." will occur.
If tomcat is not run, adb works well.
I tried all the solutions above, it fixes the issue sometimes, but still from time to time I happened to get stuck with the "Waiting for the debugger to attach" message box.
The final solution in my case was to unplug all the Android devices but the one I want to debug on. I don't know which one is the culprit: the Nexus 7 running JB 4.2, the HTC One X running ICS, the HTC Desire S running Gingerbread, or the combintation of the 3, but as soon as I only have one device plugged in, it runs smooth as silk.
I used Task Manager to kill adb.exe to solve this problem. Adb.exe will automatically start after being killed.
Killing adb.exe has solved a lot of problems related to debug and emulators for me so far.
For Android Studio users I encountered this problem first time while trying to run a bare
bone project just after updating my jdk location. So I stumbled across this post. In my case simple Build->Clean Project did the job.
I was also having the same problem when using Android Studio and GenyMotion.
I am able to solve this problem by pausing the program and resuming it again after "Waiting for debugger" message is shown. It may work while using other IDEs and emulators as well.
Android Studio 1.2.2 on Mac OS 10.10
Same problem as others have reported.
I closed Android Studio, then checked from command line in terminal:
ps -efw|grep -i android
This reported a java process (.gradle/daemon) associated with Android Studio. I killed this process, restarted Android Studio, and the problem went away.
disable you developer option in your phone.
Settings > Developer option > Disable
This worked for me, when i tried to use my application without debugging it.
What solved the problem for me was going to:
"Run"->"Attach Debugger to Android process" and then select your process.
You do this in Android Studio.
I had the same issue, fixed it by explicitly selecting desired device in debug configuration. Unfortunately, even after that log sometimes stops when debugger tries to connect. In this case in DDMS perspective find the desired process. It will be highlighted with green bug. Click stop and then debug it again.
This may be old, but for Genymotion's latest update 2.7.1, go to Developer options, if in case you dont know how to open that option, go to About phone and click Build number few times and Developer options will be enabled. Turn ON Developer option, check USB debugging.
Tested on Genymotion 4.4 and up.
Weird solution eh ? But definitely works. Hope it helps.
Happy codings.
In Debug mode Android Studio connects to your Device via socket(:8600). Somehow your socket connection is choked and thus not responding to incoming connections.
Restart Android Studio and your problem will be resolved
"Wait for debugger"in Developer options may have been set to wait your application.Please clear that option and application should run normally.