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
You can enable verbose logging for flutter if you are looking for AppId or something of that sort.
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.
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
},
),
),
));
}
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.
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
I had this issue:
I have done the following steps to resolved it:
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.