5 min read
Last update: November 28, 2021


If you use flutter run to excute your app, you can print message directly in your terminal with print(). You can use debugPrint() with material.dart dependency, there is no differences but you can use debugPrint for static log like on a try...catch in catch and print just for temporary log.

print() can print only basic types like String or bool, but Object will just print Instance of....

Example with default layout when a new flutter project is generated, here if use click on floating button, My message will appear in terminal.

// ...

class _MyHomePageState extends State<MyHomePage> {

  Widget build(BuildContext context) {
    return Scaffold(
      // ...
      floatingActionButton: FloatingActionButton(
        onPressed: () {
          print('My message!');
        child: Icon(,

You can use logger package to have beautiful logging, personnaly I use it to static logging when a tricky method is successful or failed. Here, an example to use logger

class Log {
  /// Return simple logger
  Logger get logger {
    return Logger(
      printer: PrettyPrinter(methodCount: 0, lineLength: 50),

  warn(String message) {

  info(String message) {

  danger(String message) {

class AnyClass {
  /// Method to check if [http] call is successfull or not
  myMethod() {
    final String _url = 'API URL';
    try {
      response = await http.get(
    } catch(e) {
      Log.warn('myMethod error on URL: $_url');

Dart DevTools

Dart DevTools is available on (only with Google Chrome), if you execute your app with Visual Studio Code Run, you can choose to always open DevTools (and it's generally works fine) but if you execute your app with flutter run you will see an output like:

An Observatory debugger and profiler on JSN L21 is available at:

So, you can find Observatory to but if you want to use Dart DevTools, got to and, in Connect to a Running App input, add to connect Dart DevTools to current app.

Gradle version

For some plugins, you need to upgrade Gradle. On Android, Gradle version need to be manage by Gradle plugin. You can change Gradle version on on distributionUrl, like on this example of Gradle 5.6.2

# ...

But, you need to upgrade Gradle plugin on build.gradle, on buildscript.dependencies.classpath, like on this example of Gralde plugin 3.5.0, this version can manage Gradle 5.6.2, check array below

buildscript {
  repositories {
    // ...

  dependencies {
    // ...
    classpath ''
Plugin versionRequired Gradle version 4.6+ 4.10.1+ 5.1.1+ 5.4.1+ 5.6.4+

If you want to check complete array of versions, check it on

Reduce application size

You can analyze your application with --analyze-size flag for APK or Android App Bundle for android-arm, android-arm64 or android-x64. Add the flag on build with --target-platform like this for android-arm64.

flutter build apk --analyze-size --target-platform=android-arm64

Reduce size tips:

  • Optimize assets with Optimizilla and try different formats like SVG (instead of PNG) or WEBP (instead of JPG) with Convertio
  • For your fonts, you can use google_fonts


I see this error only on physical device, try to use emulator if you can.

With a real device you can have an error about certificates. You can try some solutions by order of efficiency

  • Use fvm from, check this guide
  • Execute flutter clean
  • Clear cache of Play Store app
  • Check if the tested application is uninstalled before execute flutter run
  • Check USB cable, try to change it
  • Check USB connection mode, try MIDI if you have this option
  • Restart phone
  • Try to generate new key for signing and not migrate ,it to PKCS12 format, and update path of key in android/
  • Comment lines about key on android/app/build.gradle to create debug version without key
  • Try to update android/ storeFile path with C:\Users\USERNAME\.android\debug.keystore
    • Update storePassword and keyPassword with android to use default debug key
  • Restart computer
  • Try different physical device

Connect with WiFi

Close all virtual emulators, connect only your Android phone to your computer.

  • Assure yourself than USB debugging is enable in Development options
  • Check devices with flutter devices
  • Allow this computer fo your device
  • Find device IPv4 like in About phone

Install adb

sudo apt install -y adb
sudo scoop install adb
adb tcpip 5555

restarting in TCP mode port: 5555

adb connect

connected to

You can disconnect your device. Try to detect devices with flutter

flutter devices

If everything works, you will see your device like is connected with USB.