Why logcat is not showing anything? [duplicate]

旧时模样 提交于 2019-11-27 21:01:34
CChi

Try these first

  1. Go to the device tab, click your device. and go back to the logcat tab
  2. You might have filter set.
  3. You are probably viewing the wrong package.
vijeth.ag

I've got it solved by:

  1. Closing the logcat window

  2. Running the following in command prompt:

adb kill-server
adb start-server
  1. Opening logcat again

Every now and then I experience that the logcat output in Eclipse stops showing any logs. It doesn't matter if I unplug and plug the device. It seems like the issue occurs if the logcat gets a ton of messages, and is unable to handle the amount.

The only thing working is restarting Eclipse or use DDMS directly (which also suffers from the same problem).

Go to Window - Preferences - Android - Logcat . On that page "Show logcat view if message priority is at least " select VERBOSE.

This happens when you don't close eclipse for a long duration, just close eclipse and reopen it, your problem should be solved.

Correct answer: it is/was a bug in Eclipse. All I did to trigger it was to rename one of the filter and pressing the Run button.

Restarting Eclipse fixes it.

In eclipse, go to: windows->preferences
Then go to Android->logcat and make sure you have the following setup:
1. double-click action: "go to problem (error line)
2. switch to: java
3. both checkboxes are checked

if your setup is fine, clean the project and restart eclipse

good luck!

Some times it does happen on a slower machine that eclipse waits for emulator HOME screen and after waiting too long it shows that the emulator is offline. Secondly Make sure that you are looking in the correct filter or in all messages part.

Also you can do the following :

  1. select the device and find your process (e.g. "com.android.myapp")
  2. Look for its process id written to its left (eg. 17260)
  3. Now go to logcat and add a new filter by witting a particular name and the specific Pid (say 17260)
  4. Now select that filter and you'l be able to see your log messages

Good Luck!

I had the same issue, but gave up on eclipse logcat panel and switched to cygwin+adb:

  1. make sure the app is running and launch cygwin
  2. cd /cygdrive/c/android_sdk/sdk/platform-tools #go to where adb.exe is
  3. [optional] ./adb logcat -c #clean the log, obviously don't do this if you want to see some old messages
  4. ./adb logcat #see all messages

or

  1. ./adb logcat | grep "whatever" #look only for whatever you want to look for
  1. Go to Device from DDMS and open it.
  2. Select your device from which device your application is running
  3. Select your project which you run on this device

I had this issue for the last few days and tried everything above.

As it turned out, my problem was that all my log statements were in a class that was not being reached. I thought it had because of what was being displayed but that was not the case.

So in short, check with the following

Post log statements at the beginning of every method.

I too had the same problem , and I solved the issue by -> restart the eclipse -> go to ddms -> click on the emulator

Savan

I tried all the above solutions, but nothing did work. Then, I saw I had a button named "R", then something clicked in my mind, I renamed it to:

R1=(Button) findViewById(R.id.button1);

So maybe it was conflicting with R of Android and Java name of a button "R".
Hurray error got resolved.

Let us conclude with the following steps:

  1. Check if u have any variable(button,textview) name which is “R”
  2. Save your project, close Eclipse and then open it again.
  3. Project --> clean
  4. import android.R; remove this.
  5. Correct answer: it is/was a bug in Eclipse. All I did to trigger it was to rename one of the filter and pressing the Run button. Restarting Eclipse fixes it.

You might have switched off LogCat by Mistake

  1. Go to Preferences>Android
  2. Click LogCat and make sure there is a check next to "Monitor logcat for messages from applications in workspace"
  3. Then select the dropdown "Show logcat view if message priority is at least" and choose "VERBOSE" (or depending on how you tag your Logs, but VERBOSE will get all output)
  4. Click "Apply" and you should start seeing your messages again

Make sure that you set

android:debuggable="true"

in your manifest file.

Arti

I was facing the same problem and the following steps resolved the issue:

  1. Restart my Eclipse
  2. Restart my Emulator
  3. Select devices tab from DDMS perspective in Eclipse.

Check the device is not at fault. My device was set not to log, accidentally disabled it via boeffla kernel. After turning it back on logcat worked fine.

KlwntSingh

Go to windows->preference->android->logcat

select the option - show logcat if message priority is atleat verbose.

It will show all the events of device and close all the perpestive and open logcat it will be working again.

On right top corner click on "Display Saved Filter View" or if "display saved filter view" is already open then just click on the red - icon to delete selected logcat filter.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!