Android: Logcat doesn't show anything in Intellij IDEA - android

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.

Related

How to resolve when Logcats stops working in Android Studio?

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.

Android debugger continually disconnects

I have never had an issue debugging in Android until I switched to my current workspace. It happens in both Eclipse and IntelliJ. Previously I had an issue where the phone would hang at the "Waiting to attach debugger" dialog. Somehow I fixed that so the debugger at least attaches to my app.
Now I can set a breakpoint and have the debugger stop at that point. After about 5-10 seconds it disconnects no matter what I do. I'm able to read a few values of variables in memory before everything disappears. My co-worker is able to debug the same app just fine using Eclipse and we haven't been able to figure out what is wrong or different between our workstations (besides me using IntelliJ). We might have different images for our laptops though.
Any ideas? I've had to use Log statements for now but they are just too slow compared to using an actual debugger. I've tried using different USB cables and that didn't make much of a difference. I've gone through the debugger settings and nothing seemed out of the ordinary. Other Q/A's on SO have mentioned the app silently crashing, but I'm ruling that out due to it debugging fine for my co-worker.
I've been having the same problem running IntelliJ IDEA build IC-133.193. I solved the problem with the following actions:
Quit IntelliJ
From a command line kill the adb server with adb kill-server
From a command start the adb server as superuser with sudo adb start-server
Restart IntelliJ
IntelliJ will start the adb server if it detects that it is not running. The key appears to be starting adb as superuser before starting IntelliJ.
[Update] This doesn't always work. The best solution I've found is to start the app on the device and then attach the debugger to the Android process through the Run menu. I haven't had any disconnections using this method.
I have been fighting for a few days with adb not seeing my device. After trying many other posted solutions, I discovered that the issue was with Chrome also trying to connect its debugger to a web view. If Chrome is connected using chrome://inspect, then adb seems to disconnect. Quitting Chrome resolves the issue. Then I can connect with Android Studio and then restart Chrome and reconnect. Hope this helps someone else.
This fixed it for me
Go to Power Options on your computer
Click 'Change plan setting' on your chosen plan.
Click 'Change advanced power setting' on your chosen plan.
Expand 'USB Settings' .
Expand 'USB selective suspend setting' and change it to disabled.
This issue occurs to me when I try to use a USB 3.0 port. Using a USB 2.0 it does not happen.
This happens to me when the cable connection is sensitive.

Failed to install *.apk on device timeout Launch canceled

I read all threads about this problem but the mentioned answers in the threads don't work for me. Can I find out which is the timeoutproblem with the help of a logfile? Is it possible that on my pc are drivers which have problems with the adb? How the adb works in detail if i start the debug process? Can anybody help me with this problem? I spent 16 hours of finding out what the problem is, but the only things I found out are that the problem has nothing to do with the installation of the eclipse, the adt plugin or the android sdk installation. Something with the connection between the emulator or my real device dont work.
If i create a new project and only change the appname or the text in the standard textview, then the app can be launched on the devices. If i do more changes for example create a new layout or something then the app wont work anymore. I am very frustrating in finding out whats wrong with the adb but till now i dont have luck to solve the problem. I hope someone can help me and others with the same problem. thanks.
In eclipse, you can increase the timeout. In Eclipse, Go to preferences>In the dialog select android>DDMS>increase the timeout value
you could also try to reboot your phone, or restart your adb server
adb kill-server
adb start-server
it worked for me :)
(increasing timeout value didn't work for me)

Reconnecting Emulator to Eclipse

My main problem with developing in Android is that the emulator seems to continually get disconnected from eclipse. This always happens the 2-3 time I try to upload my .apk from eclipse without rebooting the emulator. Eclipse indicates this with an empty DDMS ->Device section and logcat stays blank - sometimes I'm not sure if the new code made it on the device.
The only fix I have for this is to shut down eclipse, and restart it. With the restarting of Eclipse, on top of the emulator boot time, I can't get any momentum going in my development.
Is there a way to reconnect the emulator to eclipse without having to restart Eclipse or even the Emulator?
Update: There were a couple of answers that helped, particularly "reset adb" or Kill-server -> connect adb. However, sometimes even that is troublesome.
I am going to try Pentium10's suggestion of hooking up my G1 and using it as an emulator, but for now, I have found that if I don't see my logcat going, and the emulator is working (This is my biggest problem, because I am outputting all my debugging messages to log) then I can open up CMD and type adb logcat. This streams the log into the command window. Not nicely color coded, but nice enough for me to find my problems...
In eclipse go to Window->Show View->Other->Android->Devices. When your application is run go to this tab and you will see the emulator. If your emulator becomes unresponsive, in the devices tab you will see a down arrow at the right. Click the arrow and a context menu shows up. Hit the option Reset adb.
Just had to do this and it worked beautifully, but it did require you to reset the emulator - though I didn't wait to see if it reconnected on its own.
Try to call 'Reset adb' menu item from DDMS > Devices tab. It helps me in this case.
At most of the time you don't need to restart the emulator.
AFAIK the only workaround for this is to restart Eclipse (I always use this), or use a real phone.
Try adb kill-server, followed by an adb connect
I've had luck reconnecting to the disconnected emulator by entering an adb-over-tcp command line which you can look up in the docs. I think the address and port to use are the ones in the title bar of the emulator window, if not try the next higher port. Once it's back in adb devices eclipse should use it.
in terminal:
$adb kill-server && adb start-server

ECLIPSE ANDROID DEVICES DISAPPEAR

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/

Categories

Resources