I have a problem with the Android emulator. After I run my application on a device it disappear from DDMS at some moment with no reason, even if it is still started. The only way to run again is to close the previous emulator and reopen it by running my application.
Do you have any solution for this strange error ? I must say that I can't deactivate my firewall if that is the problem. Also I tried to reset ADB but still doesn't work.
An answer for others that will come here looking for a solution.
You just need to restart ADB (kill-server and then start-server).
More details on how to do so: http://developmentality.wordpress.com/2010/09/13/android-disappearing-emulator-restart-adb-server/
Related
Logcat has stopped working for me again in Android Studio. Last time it happened I had to reinstall the IDE, and I want to avoid it again.
What I did for this to happen was changing...
Log.d("WRONG", "TEST");
to
Log.d("LOG", TEST");
and then changed the tag back to "WRONG" again. Now Logcat wont show any of my debug messages even if I remove WRONG from the filter when the app is running on my phone. The emulator still provides debug messages.
I already tried:
Checked if Android Device Monitor is active.
Restarting Logcat.
Change from Verbose to Debug and back to Verbose.
Unplugging the phone.
Restarting Android Studio.
Invalidate cache / Restart (in File menu).
Uninstalling the app.
Restarting the computer.
All of the above at the same time.
Changing phone.
Switching USB cable.
Opening Android Studio Manager. It bugged out and the log told me »java.io.IOException: The folder "C:\Users\Logga%20in.android\monitor-workspace.metadata" is read-only.«
[edit: tried even more solutions]
Using the terminal in Android Studio. Going to android sdk\platform-tools folder and typing adb kill-server followed by adb start-server.
opening Dalvik Debug Monitor through Command and checking the log there.
adding android:debuggable="true" to the manifest (under the application tag).
I'm using Android Studio 2.1 but the same thing happened when I was using 2.0b.
In my case in Android 2.2, for some reason, Firebase was selected by default in the dropdown box marked above. So logs didn't drop. I just needed to change it to No Filters
Hope this helps someone.
I finally got the log to start working again.
I did some updates in Android Studio, mostly just the repositories, but what I think was the real solution was to turn off my phone and have it turned off for about fifteen minutes. After that, the log started to work again.
try this,
Remove WRONG key word which is written in log cat search.
hope it will help you.
I selected no filter, cleared logcat buffer on device and then restarted the app and changed the filter back to "show only seleced application"
this ended up working for me :)
Reboot your PC. It happens to me once i restarted my PC worked fine.
To get a particular Logs from your application. You can use Create New Logcat Filter dialog which appears after selecting Edit Filter Configuration to create your own filter. And From filter option select My Tag
Mine stopped working twice in the past few weeks but it was not just log but the functionality I was implementing wouldn't work as well. I was running my code in an emulator. The solution was to plug in my phone and run it on my phone. It worked the first time on my phone. Only after it started working there did restarting the emulator work.
Logcat output is emtpy in Intellij IDEA - what to do?
An application is running (live wallpaper), log level is Verbose, device is chosen correctly, ADB and USB debugging are enabled.
Pressing the following button always fixes it for me.
I often see this problem with eclipse IDE, restart IDE (or ADB by command line) is my solution.
to restart ADB:
sudo adb kill-server
sudo adb start-server
It seems that adb sometimes gets disconnected from Intellij. You could restart the server or Intellij, but it's easier to just go to:
Tools -> Android
and then turn "Enable ADB Integration" off and then back on.
Just restart your logging in IntelliJ. My version is 15.
I have same problem as well.
But temporary solution is from menu go to "tools>Android>Monitor (DDMS included)"
It will be displayed Android Debug Monitor and you will be able to see your logs.
Make sure that Eclipse/ADT is not running in parallel and accessing the phone.
It's not a direct answer to your question but a possible solution if you're willing to migrate:
I kept on having this problem, sometimes a restart worked temporarily. After a while I decided to give Android Studio's a try (which is build upon Intellij). I haven't had the problem for a while and Android Studio's feels a lot like Intellij, love it!
In my situation "Resume" (see: Run -> Resume in AndroidStudio) was colored. After clicking the lable Locgat did it's job...
I really don't know what messed up my phone (running Lollipop) the last hour - but I never had such a fight to get adb / logcat running.
It seems that the system had stored the state of the application through a reboot oO Is this possible, at all? I don't know why AndroidStudio showed the resume-entry "highlighted", after the rebooting my device I didn't run the app...
If you are newbie to android like me, I was pulling my hairs out for not being able to debug. It so just happened to be that i 'accidentally' pressed that little button which hides this screen. Click it again and it will come back.
I hope this answer will be useful for you, and for many others.
The emulator won't launch my apps even on a real device! I've tried every solution online, even reinstalling android sdk,ADT plugin. The app run SOMTIMES(4x to be exact) though, like awhile ago, when i got home i tried it again, and it run on my first try then i began working on the code again then i tried to run it, won't run again. Even basic apps like hello world won't run most of the time. I've set the run configuration to let me choose my device everytime, but even the device chooser wont show up(showed up once only), i tried waiting for 30 minutes(also tried the kill-server start-server) but it just wont run! my real device, or the emulator is listed on the DDMS perspective and there's nothing on console. please help, cause I've wasted 2 days for this already.
Have you also tried, taking the USB cable then disabling debugging and then enabling debugging and putting the USB cable back.
I remember this happen to me, so I did what I mentioned and surprisingly it works. Hope it work for you too.
Maybe you should try deleting your emulator and creating a new one. Make sure that all your settings are correct and that you are targeting the right OS version.
I've had quite a few problems with the emulator and wiping them and starting from scratch worked more often than not.
As for the real device, the first real hurdle is getting the right drivers so that your PC can recognize it, after that kill-server start-server usually does it. I'm surprise that didn't work for you.
I'm using Eclipse Indigo and up until just a couple hours ago or so everything was working fine. When I just relaunched it and made a couple changes, I ran the program on my phone but my logs were not being displayed. The phone's logs are displayed in the logcat, but nothing from the project is. I have the device selected, I've tried restarting eclipse multiple times, I've reset the ADB, and I've run the commands adb usb and adb logcat (which still doesn't display my logs). I know my logs are correct: Log.e("Tag","Message"); Anyone have any other ideas?
As it turns out, it was a stupid error on my part. I had my logs set up as: Log.e("Tag","") instead of: Log.e("","Message"). Apparently, if you have the former, it won't display to the LogCat, go figure?
I think, you haven't selected device or emulator , on which running your application,
In eclipse go to DDMS Perspective and select device or emulator on which you are running your application.
(Note: No need to restart the Eclipse)
I've done everything to the 'T' in regards to installing the Android SDK/ADT. I've tried all methods to resolve this (adb kill, wipe data), but still nothing.
When I run it from the SDK manager, the loading process works, but once it is done, a flash of the emulator appears then quickly disappears.
Sometimes after it loads, nothing happens.
At the worst when it loads, I get the "too many emulator instances are running on this machine. Aborting" message.
I want to start making apps, but this seems to be the only thing stopping me!
Eclipse Indigo; r12, Windows 7 (64)
If you have Windows Firewall (or another software firewall) active, try temporarily turning it off and then running the emulator. If that clears up the problem, then you need to teach the firewall how to open up the ports the emulator needs.
Go through your services and kill anything you find from it, including the java runtime, then run the AVD Manager as Admin and start the emulator from there, that should fix it.
I try to always make a habit of running Eclipse as Admin too because it's needed for the Emu to run properly.