Home » Android » Android Studio not showing Logcat with Flutter

Android Studio not showing Logcat with Flutter

Posted by: admin April 23, 2020 Leave a comment

Questions:

I’m using Android Studio for Flutter App Development. Everything seems to be working fine just that the Android Studio does not show the “logs” in Logcat. In the Logcat section, it says “Please Configure Android SDK”. Which is already configured. And in the Logcat section says “No Connected Devices.” in the drop-down menu. When it has recognized my Android Phone and is showing it just under the Menu bar.

Is there a fix for it? Is there something I am missing?

enter image description here

How to&Answers:

Update April 2020: Cuong’s answer works better with Android Studio 3.6+


Previous answer:

Flutter use Run tab to display logs in Android Studio. Switch from Logcat to Run and then you will see logs.

Answer:

Go to Setting/Preferences -> Languages & Framework -> Flutter ->
Check or uncheck Replace the Run and Debug console with an experimental Flutter Loggin view

Answer:

Try Event Log > scroll to Android framework is detected > click Configure.

This should make the Logcat visible with logs shown. Moreover, Device File Exprorer should show up on the right panel.

Answer:

In Flutter apps you can log text using the print() statement.

print('hello');

As others have said, you can use the Run tab in Android Studio to view these logged comments.

enter image description here

Here is the code for main.dart:

import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Center(
      child: RaisedButton(
        child: Text('Button'),
        onPressed: () {
          print('hello'); //               <-- logging
        },
      ),
    ),
  ));
}

Answer:

Just open another NATIVE project for Android Studio in other window and the logcat will work, do it while Flutter project is open. That was the solution for me

Answer:

Open Project Stucture -> Modules -> new android module from exists source.

Logcat & Device File Explorer will be visible.

Answer:

Switch to the “Run” tab to see the logs and if you want to insert logs (like Log.d() in android), you can use print() function and whatever string you pass into it will be printed into the “Run” window.

Answer:

I guess it’s an ADB issue. You can restart AS (or maybe even your Computer) or what i usually do is open the terminal an then: adb kill-server && adb start-server (I think the second part adb start-server is not necessary because it seems that AS handles it automatically) – anyways this is how LogCat and Android (and Flutter) work for me every time.

Answer:

When i face this problem I just go to File and open my existing native android project and then close it. This solution also works when abd Wifi pludings does show warning like => adb not found.

Answer:

Flutter has not logcat flutter show error in the console inside Run tab.IF you want to see error and crash report click on run tab.

Answer:

Just use command ‘flutter logs’, then you can see all logs which are printed by ‘print’ or ‘debugPrint’ function.

Answer:

when you open flutter project, IDE prompts you to configure android project. Just click on the recommendation and it will start showing logcat window.

Answer:

Looks like everything works once you properly configure Android SDK in project settings.

Some more details here: https://github.com/flutter/flutter/issues/16691