Android Studio 3.0 Logcat显示‘无内容’,添加Filters后日志仍不显示求助
Hey there, let's work through this Logcat problem you're hitting. I've run into similar glitches with older Android Studio versions, so here are practical steps to get your logs visible again:
1. Use Valid Log Tags
Your current code uses empty tags like Log.d("", "AAAAAA-------")—while this isn't technically invalid, Android Studio 3.0 sometimes struggles with empty tags when filtering logs. Try using a non-empty, consistent tag for all your logs, which also makes filtering easier:
Log.d("LogTestActivity", "AAAAAA-------"); Log.d("LogTestActivity", "AAAAAA-BBBBBBB");
2. Double-Check Logcat Filter & Process Selection
It's easy to overlook these basic settings:
- Make sure you've selected the correct device/emulator and your app's process (look for your app's package name, e.g.,
com.yourdomain.logtest) in the top dropdowns of the Logcat panel. - Switch the log level filter to Verbose or Debug—if you have it set to Info/Warning/Error, your
Log.d()statements won't appear. - If you're using a custom filter, verify its rules: ensure the tag matches your Log statements, and there are no accidental exclusion filters enabled.
3. Clear Caches & Restart
Android Studio 3.0's cache can sometimes get corrupted, causing Logcat to stop updating:
- Click the trash icon in the Logcat panel to clear existing logs.
- Close Android Studio, then delete the
.ideaandbuildfolders in your project directory. Restart AS and rebuild your project. - Reboot your device/emulator too—occasionally the device's log buffer gets stuck and needs a refresh.
4. Verify Logcat Settings in Android Studio
Check if your IDE's Logcat configuration is blocking logs:
- Go to
File > Settings > Build, Execution, Deployment > Debugger > Logcat(on Windows). - Ensure "Show logcat automatically" is enabled, and there are no custom global filters that might be hiding your logs.
- Make sure you haven't accidentally enabled "Silent logs" mode, which suppresses all log output.
5. Confirm Your Code is Running
Don't forget to:
- Re-deploy your app after modifying Log statements—just compiling won't update the running app on your device.
- Verify that
LogTestActivityis actually being launched: check yourAndroidManifest.xmlto confirm the activity is registered, and that it's either the launcher activity or being navigated to correctly.
内容的提问来源于stack exchange,提问作者taehunkim

