flutter-intellij: Autocomplete does not work in Android Studio

Steps to Reproduce

Please tell us what you were doing and what went wrong

  • Create a new flutter project
  • Create src folder in lib with baz.dart and foo.dart files
  • Add this to foo.dart: class Foo {}
  • Start typing in baz.dart: class Bar extends Fo

Android Studio does not have autocomplete:

android_studio

Visual Studio Code does have:

visual_studio_code

IntelliJ Ultimate also does:

intellij

Version info

Please paste the output of running flutter doctor -v here (available from the command line or from Tools > Flutter > Flutter Doctor). It will provide the version of the Flutter framework as well as of the IntelliJ plugin.

[√] Flutter (Channel dev, v1.5.8, on Microsoft Windows [Version 10.0.17763.475], locale en-US)
    • Flutter version 1.5.8 at C:\Users\Meee3\Documents\flutter_v1.2.1_stable\flutter
    • Framework revision 0ba67226ee (11 days ago), 2019-04-24 17:18:28 -0700
    • Engine revision c63d1cf9c9
    • Dart version 2.3.0 (build 2.3.0-dev.0.1 1f1592edce)


[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\Meee3\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: C:\Users\Meee3\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\183.5452501\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[√] Android Studio (version 3.4)
    • Android Studio at C:\Users\Meee3\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\183.5452501
    • Flutter plugin version 35.2.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[√] IntelliJ IDEA Ultimate Edition (version 2019.1)
    • IntelliJ at C:\Users\Meee3\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\191.6707.61
    • Flutter plugin version 35.2.3
    • Dart plugin version 191.7019

[√] VS Code (version 1.33.1)
    • VS Code at C:\Users\Meee3\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 2.26.1

[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.

If I switch back to the stable channel, there is no difference in autocomplete.

Checking Dart SDK version...
Downloading Dart SDK from Flutter engine 3757390fa4b00d2d261bfdf5182d2e87c9113ff9...
Unzipping Dart SDK...
Building flutter tool...
Running pub upgrade...
[√] Flutter (Channel stable, v1.2.1, on Microsoft Windows [Version 10.0.17763.475], locale en-US)
    • Flutter version 1.2.1 at C:\Users\Meee3\Documents\flutter_v1.2.1_stable\flutter
    • Framework revision 8661d8aecd (3 months ago), 2019-02-14 19:19:53 -0800
    • Engine revision 3757390fa4
    • Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at C:\Users\Meee3\AppData\Local\Android\sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: C:\Users\Meee3\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\183.5452501\jre\bin\java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
    • All Android licenses accepted.

[√] Android Studio (version 3.4)
    • Android Studio at C:\Users\Meee3\AppData\Local\JetBrains\Toolbox\apps\AndroidStudio\ch-0\183.5452501
    • Flutter plugin version 35.2.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[√] IntelliJ IDEA Ultimate Edition (version 2019.1)
    • IntelliJ at C:\Users\Meee3\AppData\Local\JetBrains\Toolbox\apps\IDEA-U\ch-0\191.6707.61
    • Flutter plugin version 35.2.3
    • Dart plugin version 191.7019

[√] VS Code (version 1.33.1)
    • VS Code at C:\Users\Meee3\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 2.26.1

[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.

As a note:

I of course do not need Android Studio and IntelliJ at the same time, I just spent too much time trying to establish autocomplete in Android Studio that I have downloaded everything possible and could not imagine there was a difference between any IDEs, let alone IntelliJ and Android Studio.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 2
  • Comments: 21 (2 by maintainers)

Most upvoted comments

Is autocomplete available in Android Studio now?

Yes, it is, if the autocomplete isn’t working for you in Android Studio, just press File and uncheck the Power save mode, it should work fine after that.

Do you have any suggestions how to fix code completion. In my case:

  • I restart Android Studio and open my Flutter project, and code completion works fine.
  • I run my app on the Emulator
  • Now code completion doesn’t work anymore

Running the app somehow breaks Code completion, maybe it has something to do with the new DevTools integration in Android Studio, but I’m just guessing here. Please help. image image image

ezgif-2-ac4f160cc18e

Auto complete does not work on my M2 after installing android studio

Yes, it is, if the autocomplete isn’t working for you in Android Studio, just press File and uncheck the Power save mode, it should work fine after that.

Thank You so much for this solution.

I have an issue with auto complete text view. Posted a question on stack. can anyone pl check it?

@Muzm My OS is Win10, maybe it just happen on windows. My colleague use macOS, it work fine.

@shubhangijadhav30 I tried build a new project, and copy the original folder “lib” to the new project. The code completion was still not work.

I think some spefic code will make it happen. I’ll try to find it.

You just create a new project and start working there !! Auto completion of code will surely work !! It happened with me and my friend but for only 1 project our other projects do not have this problem .

  • I restart Android Studio and open my Flutter project, and code completion works fine.
  • I run my app on the Emulator
  • Now code completion doesn’t work anymore

exactly the same problem! I been search solution for month and nothing was found. before hit the run/debug button widget and import autocomplete was good, after run/debug it all broken. restart the inteillj/android studio autocomplete will be back, only when I NOT CLICKED the run/debug button.

here is my flutter doctor and flutter plugin version: image image

edit: after reset my OS(win 10) and reinstall flutter 1.22.5, the problem still exist

checking and then un-checking File > Power Save Mode made autocomplete start working again for me too.