Android Studio not showing Logcat with Flutter

AndroidAndroid StudioFlutterLogcat

Android Problem Overview


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

Android Solutions


Solution 1 - Android

Try the following:

  • Event Log (a tab at the bottom right) enter image description here

  • scroll to Android framework is detected

enter image description here

The Logcat tab should appear now. Moreover, the Device File Explorer tab should show up on the right panel.

Solution 2 - Android

I just solved this, the flutter project was missing an Android module. Go to 'File -> Project Structure -> Modules'. Click on the '+' sign at the top to add a module. Select Android.

Solution 3 - Android

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.

Solution 4 - Android

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

Solution 5 - Android

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

Solution 6 - Android

Find a way around it (macOS).

Go to Project Structure -> Facets -> "+" -> Android -> Select Project Logcat should now be visible. Configure Android SDK if not done previously and you should be able to use Logcat.

Reference https://github.com/flutter/flutter-intellij/issues/2724

Solution 7 - Android

When I first came to Flutter from an Android background, I didn't know where to find the log statements. I didn't care so much about all of the system messages. I just wanted to see log messages from my app during development. This answer is for people like that, not for people who specifically need LogCat itself.

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
        },
      ),
    ),
  ));
}

Solution 8 - Android

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

Logcat & Device File Explorer will be visible.

for Android Studio 3.6: File -> New -> New Module -> Android Library

Solution 9 - Android

I had this issue: I have done the following steps to resolved it:

  • Click the event log on the bottom right of android studio enter image description here
  • Click on configure enter image description here
  • Click on Ok in the dialog box

enter image description here

  • Logcat will be available nowenter image description here

Solution 10 - Android

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.

Solution 11 - Android

1.

Go to Menu and select 'Project Structure' -> 'Project'

enter image description here

2.

In 'Project Structure' Select Project SDK

enter image description here

And just now click on OK and Apply.

Solution 12 - Android

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

Solution 13 - Android

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.

Solution 14 - Android

Run

adb logcat

and watch from terminal. Doc: https://developer.android.com/studio/command-line/logcat

Solution 15 - Android

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

Solution 16 - Android

In case you accidentally refused to configure Android framework and now struggling to find the LogCat window. Then delete .idea, .dart_tool and .gradle folders in project root and android folder. Then Invalidate and restart. It will ask to configure detected Android framework. Click 'configure'.

Solution 17 - Android

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.

Solution 18 - Android

I found a solution worked for me:

for MacOS: Go to: /Users/userName/Library/Preferences/AndroidStudio3.4/options Find "runner.layout.xml" Change the name of this file for ex: runner01.layout.xml Restart Android studio

for Windows: 1- Focus "Run" tab (click on tab header, not on its body) 2- Ctrl+Shift+A, find and click "Restore Layout"

References: https://github.com/flutter/flutter/issues/25835 https://github.com/flutter/flutter-intellij/issues/3673#issuecomment-517356243

Hopefully, it helps.

Solution 19 - Android

In my case, I also had an error in the Device File Explorer: Error initializing ADB: Android Debug Bridge no found. I fixed the problem following https://stackoverflow.com/questions/57291708/error-initializing-adb-debug-bridge-not-found: I selected the latest Android API Platform as Project SDK in File/Project Structure.

Solution 20 - Android

Just go to File => Project Structure => and in the “SDK project” choose “Android

Solution 21 - Android

  1. close project
  2. delete .dart_tool,.idea,build files
  3. start android studio,logcat will display

Solution 22 - Android

In new versions of Android Studio, after deploying the app to device/emulator, in Run Tab you will see an option for flutter dev tools as shown in the image, it will open in browser (based on default chrome/edge) and there you can see logcat/logging

Android Studion artic for run tab

Flutter Dev Tools

Flutter Dev Tools in Google Chrome

Solution 23 - Android

  1. Go to File > Project Structure Project or use cmd + ; or

  2. Then click on "Facets" and press + icon in the upper right corner and add Android from the list.

    enter image description here

Credit to @MrWeeMan

Solution 24 - Android

You can enable verbose logging for flutter if you are looking for AppId or something of that sort.

enter image description here

Solution 25 - Android

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.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionVoidMainView Question on Stackoverflow
Solution 1 - AndroidOnikView Answer on Stackoverflow
Solution 2 - AndroidSyed SaadView Answer on Stackoverflow
Solution 3 - AndroidDaniil YakovlevView Answer on Stackoverflow
Solution 4 - AndroidCuong TruongView Answer on Stackoverflow
Solution 5 - AndroidROBView Answer on Stackoverflow
Solution 6 - AndroidMrWeeManView Answer on Stackoverflow
Solution 7 - AndroidSuragchView Answer on Stackoverflow
Solution 8 - AndroidBuffKView Answer on Stackoverflow
Solution 9 - AndroidRissmon SureshView Answer on Stackoverflow
Solution 10 - AndroidLeonard ArnoldView Answer on Stackoverflow
Solution 11 - AndroidSandeep PareekView Answer on Stackoverflow
Solution 12 - AndroidJC ZhongView Answer on Stackoverflow
Solution 13 - AndroidRavinder KumarView Answer on Stackoverflow
Solution 14 - AndroidCaio SantosView Answer on Stackoverflow
Solution 15 - AndroidMangesh KadamView Answer on Stackoverflow
Solution 16 - AndroidKairat DoshekenovView Answer on Stackoverflow
Solution 17 - AndroidJaswant SinghView Answer on Stackoverflow
Solution 18 - AndroidK-SolimanView Answer on Stackoverflow
Solution 19 - AndroidshieldView Answer on Stackoverflow
Solution 20 - AndroidGaraView Answer on Stackoverflow
Solution 21 - AndroidKeeuView Answer on Stackoverflow
Solution 22 - AndroidSumitView Answer on Stackoverflow
Solution 23 - AndroidiDecodeView Answer on Stackoverflow
Solution 24 - AndroidTilak DewanganView Answer on Stackoverflow
Solution 25 - AndroidSamView Answer on Stackoverflow