14

I am using Flutter + the Android Studio/IntelliJ plugin for Flutter. When I run my application in the IDE, there seems to be an empty console window so I cannot view my print statements from that window.

I am able to view output in the tomcat logs, so I am not blocked by this problem. Is there any reason why there is no output/functionality is my run window?

Update

Tried running using flutter run on commandline and I get my print statements on there. So this is just limited to Android Studio.

What I am expecting

enter image description here

What I am getting

enter image description here

Versions and App Information

Flutter Doctor Output

D:\manual-applications\flutter\bin\flutter.bat doctor --verbose
[√] Flutter (Channel beta, v1.0.0, on Microsoft Windows [Version 10.0.16299.785], locale en-US)
    • Flutter version 1.0.0 at D:\manual-applications\flutter
    • Framework revision 5391447fae (3 weeks ago), 2018-11-29 19:41:26 -0800
    • Engine revision 7375a0f414
    • Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)

[!] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at D:/android-development/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • ANDROID_HOME = D:/android-development/sdk
    • Java binary at: D:\android-development\android-studio\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
    X Android license status unknown.

[√] Android Studio (version 3.2)
    • Android Studio at D:\android-development\android-studio
    • Flutter plugin version 31.3.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[!] IntelliJ IDEA Community Edition (version 2018.2)
    • IntelliJ at C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 2018.2.2
    X Flutter plugin not installed; this adds Flutter specific functionality.
    X Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[√] VS Code, 64-bit edition (version 1.28.2)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 2.21.1

[√] Connected device (1 available)
    • Android SDK built for x86 64 • emulator-5554 • android-x64 • Android 7.1.1 (API 25) (emulator)
Shiraaz.M
  • 3,073
  • 2
  • 24
  • 40
  • restarting android studio and relaunching the app workaround the issue. This is not a solution since some time later the output is not routed properly to the debug console – Jossef Harush Kadouri Feb 09 '19 at 09:54

12 Answers12

9

This happens, when you hide the console from the run window. i.e., Press here.

Unfortunately, Android Studio doesn't show a minimized icon, where we can tap to bring it back. Neither is there any shortcut assigned to this button.
You can bring it back by running the app in the debug mode. You can either see the logs there or kill it and run again in the run mode and you will see your logs back.

P.S. if you can't see your console even in the debug mode. Look for an icon like this on the top right corner of the window.
enter image description here

RoyalGriffin
  • 1,987
  • 1
  • 12
  • 25
5

You might have mistakenly minimized the console output. But after you click it there is now way to restore it!

Here is the nasty button (the small arrow on console's tab works too!)

enter image description here

As said on flutter-intellij issues tracker and thanks to @sosite's answer, you will have to restore ~/Library/Preferences/AndroidStudio3.4/options/runner.layout.xml (you might need to change AndroidStudio3.4 with your own version) this lines:

   <ViewImpl>
     <option name="ID" value="ConsoleContent" />
     <option name="minimizedInGrid" value="false" />
     <option name="placeInGrid" value="bottom" />
     <option name="tabIndex" value="-1" />
     <option name="window" value="0" />
   </ViewImpl>

Replace

<option name="minimizedInGrid" value="true" />

by

<option name="minimizedInGrid" value="false" />

And it's back again!

Hugo H
  • 6,029
  • 5
  • 37
  • 57
3

Firstly select or click on Run tab then go to File > Settings > Languages & Frameworks > Flutter > and check the option 'Replace the Run and Debug console output with a custom Flutter Logging View'

Flutter Settings in Android Studio

Resulting something like

Run and console tab for Flutter in AndroidStudio

Oscar Albert
  • 803
  • 8
  • 13
2

In the debug window (View -> Tool Widows -> Debug)

enter image description here

Then select Console

enter image description here

atreeon
  • 21,799
  • 13
  • 85
  • 104
1

My problem was with Android Studio 3.5 beta 5 itself. He has bundled IntelliJ 2019.1 so it's probably also a problem with it. It happened to me few times so I found a corrupted file. It's runner.layout.xml in <IDE_PATH>/config/options dir where <IDE_PATH> is:

  • On Windows: <SYSTEM DRIVE>\Users\<USER ACCOUNT NAME>\.<PRODUCT><VERSION> eg. C:\Users\Somebody\.AndroidStudioPreview3.5
  • On Linux: ~/.<PRODUCT><VERSION> eg. /home/somebody/.IntelliJIdea2019.3
  • On MacOS: ~/Library/Preferences/<PRODUCT><VERSION>

I share my working runner.layout.xml file:

<application>
  <component name="RunnerLayoutSettings">
    <runner id="JavaRunner">
      <ViewImpl>
        <option name="ID" value="ConsoleContent" />
        <option name="minimizedInGrid" value="false" />
        <option name="placeInGrid" value="bottom" />
        <option name="tabIndex" value="0" />
        <option name="window" value="0" />
      </ViewImpl>
      <TabImpl>
        <option name="bottomProportion" value="0.0" />
      </TabImpl>
      <General />
    </runner>
    <runner id="Android">
      <ViewImpl>
        <option name="ID" value="Android Logcat" />
        <option name="minimizedInGrid" value="false" />
        <option name="placeInGrid" value="center" />
        <option name="tabIndex" value="0" />
        <option name="window" value="0" />
      </ViewImpl>
      <TabImpl />
      <General />
    </runner>
    <runner id="Debug">
      <ViewImpl>
        <option name="ID" value="FrameContent" />
        <option name="minimizedInGrid" value="false" />
        <option name="placeInGrid" value="left" />
        <option name="tabIndex" value="0" />
        <option name="window" value="0" />
      </ViewImpl>
      <ViewImpl>
        <option name="ID" value="VariablesContent" />
        <option name="minimizedInGrid" value="false" />
        <option name="placeInGrid" value="center" />
        <option name="tabIndex" value="0" />
        <option name="window" value="0" />
      </ViewImpl>
      <ViewImpl>
        <option name="ID" value="OverheadMonitor" />
        <option name="minimizedInGrid" value="false" />
        <option name="placeInGrid" value="right" />
        <option name="tabIndex" value="0" />
        <option name="window" value="0" />
      </ViewImpl>
      <ViewImpl>
        <option name="ID" value="ThreadsContent" />
        <option name="minimizedInGrid" value="false" />
        <option name="placeInGrid" value="left" />
        <option name="tabIndex" value="0" />
        <option name="window" value="0" />
      </ViewImpl>
      <ViewImpl>
        <option name="ID" value="ConsoleContent" />
        <option name="minimizedInGrid" value="false" />
        <option name="placeInGrid" value="bottom" />
        <option name="tabIndex" value="1" />
        <option name="window" value="0" />
      </ViewImpl>
      <TabImpl>
        <option name="displayName" value="Debugger" />
        <option name="leftProportion" value="0.19965477" />
        <option name="rightProportion" value="0.19965477" />
      </TabImpl>
      <TabImpl>
        <option name="bottomProportion" value="0.0" />
        <option name="defaultIndex" value="1" />
        <option name="index" value="1" />
      </TabImpl>
      <General />
    </runner>
  </component>
</application>
wrozwad
  • 2,610
  • 1
  • 30
  • 38
  • 1
    For me it wasn't the beta version but a bad click on the bad button. See my answer above: https://stackoverflow.com/a/57495406/1847249 – Hugo H Aug 14 '19 at 13:10
1

The easiest way is to make a compilation error like that const String a = 1234; Thanks to yurkoaapelsinn

Islam Ahmed
  • 668
  • 9
  • 19
0

You did not add Android tools to your CLASS PATH. You can do it like below

set ANDROID_HOME=C:\ installation location \android-sdk

set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools

Taken from this

Alex Adrianov
  • 312
  • 1
  • 8
0

For me, the only thing that helped:

  1. First step. I switched dart SDK path Preferences -> Language & Frameworks -> Dart to other than one that is cached inside flutter directory (I suppose it is the one I installed as a standalone dart SDK; it locates on my machine in /usr/local/Cellar/dart/2.2.0/libexec).

  2. Second step. I went in Flutter section (Preferences -> Language & Frameworks -> Flutter), Flutter SDK path was empty & I pointed to the directory with installed flutter sdk.

Worked on MacOS.

Ilia Kurtov
  • 999
  • 1
  • 12
  • 18
0

Select Project SDK from drop down menu. Locate Project Structure from File menu, AS.

Select Project SDK from drop down menu. Locate Project Structure from File menu, AS

John Ravi
  • 1,190
  • 1
  • 12
  • 21
0

Fix logs by clicking icon

To fix log just click on selected icon

Ya Si
  • 819
  • 7
  • 12
0

For me I need to right-click [4:Run] -> Close then run the app and it reappeared.

Hai nguyen thanh
  • 718
  • 7
  • 17
0

enter image description here

  1. disable run in menu.
  2. enable run.
  3. start project.
I resolve it in android studio 4.1.2
Abhishek Dutt
  • 1,308
  • 7
  • 14
  • 24