Android studio logcat not working

2020-02-10 11:49发布

问题:

There is very awkward thing I am facing logcat is shown in debugging application but while running(not debugging) application it is not showing logcat .

I tried restart it but nothing is happening.

回答1:

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. Then it worked.

I even tried restarting the logcat, that didn't work too. No Filters did the magic.

Hope this helps someone.

Edit: You can as well select Show only selected application for logcat to show only the current debugging process, i.e your app.



回答2:

  • You may be hiding it, try pressing Alt + 6 to open Log tab.

  • Look at the log level:- it must be verbose.

  • Restart adb.

  • If that doesn't works restart the android studio.



回答3:

I found the following worked for me.

First, my problem: i was testing an app on a Samsung Galaxy A3 attached via usb cable. I was getting the usual logCat messages, including the filtered ones then all of a sudden the logCat stopped displaying filtered messages. Setting it to Verbose displayed a continues stream of messages with a mesage at the top left corner of the lagCat stating "too much output to display".

I tried restarting Android Studio (with and without clearing the cache) but no luck. I then rebooted my phone and everything was back to normal. So it appeared that the attached phone was the problem, sending too much info to the logCat.

Hope this helps someone.



回答4:

Besides what other guys said, look if you have written something in the search box that causes this problem(it was my case).

Note: Even in case of a restart, what you have written in search box won't delete and you need to delete it yourself.



回答5:

on The top left of logcat there is an option to choose the emulator. may it's not selected the current emulator by default. try to changing it to current emulator and it will fix.



回答6:

In Logcat window reselect your device then reselect your app

if it didn't appear restart adb using two commands:

adb kill-server
adb start-server

Happy debugging :)



回答7:

Restarting both emulator and android studio worked for me!



回答8:

I fixed the issue by changing the USB Options of my phone from "Charging only" to "Transfer files (MTP)"



回答9:

I have solved this issue by enabling "Use libusb backend" option in Android Studio -> Preferences -> Debugger -> Android Debug Bridge (adb).



回答10:

You need to press Alt+6 twice to restart the logcat window. That way it'll show the log outputs.


Go to your sdk Folder --> Platform tools -->  adb  click 2 times 

using this adb server restart again 

Please check your Sdk Location My Location is d drive Please See This



回答11:

I had this code:

 Log.e(getMyName(),message);

The problem with this was, the variable that the getter method was accessing was null. Android Studio did not give me any error about it! Seems this was silently not letting the Log.e statement to work. I checked many blogs but couldn't find the solution. This small miss wasted my complete one hour. Hope this helps someone.



回答12:

Check you don't have something in the logcat search that returns no matches, for example a non existent package name.

I had renamed my packages, but left an old name in the logcat search field. Result: No logcat output visible



回答13:

I tried to switch "Extended log" in my device settings from "Selectivly" to "Allowed" and it helped. Now debug info appears in LogCat.



回答14:

i had the kind of issue the way which got me the logcat to work was that i was notchoosing the right filter.as i was using sqlite(Database) and in filters i had choosen firebase.so that's why my logcat was not working



回答15:

This feels really stupid, but I spent a couple hours struggling with the same issue. I tried every other answer in this thread, but what fixed it for me was Cleaning and then Rebuilding. Apparently when I ran, it wasn't actually rebuilding the APK, just running the one that had already been made.



回答16:

Try the following Steps:-

Step 1. Goto File > Invalidate Caches and Restart > Invalidate and Restart. Android Studio will restart automatically and logcat will work as expected.

Refer screenshots :

Step 2. If Step(1) didn't worked then try this : Goto Terminal > cd till your platform-tools directory (eg. in Windows default location is C:\Users\\AppData\Local\Android\Sdk\platform-tools). Now type following command :

adb kill-server

adb start-server

Step 3: If Step(1)&(2) both didn't worked then simply try clicking on Re-Start Logging button available in Logcat option. Refer screenshot - (Green colour curved arrow with grey box)



回答17:

I had the same issue, and I resolved it by the following actions:

First, open the terminal in android studio and navigate to the following path:

C:\Users\user_name\AppData\Local\Android\Sdk\platform-tools

Second, enter the command: adb reboot.

It takes about 2 minutes, but now logcat is functioning again and showing every logcat.



回答18:

I tried all the above answers. Helped restart the device (HTC)