5

I am a starter in android development and I started off with eclipse.. But it started giving lot of problems. So I switched to android studio. Got it set up successfully and for couple of weeks it was ok. Now, for some reason, the auto complete feature is not working. It is not giving any choices while typing, so I tried ctrl-enter. It says no suggestions. I browsed through similar queries and tried the following.

  1. Disabling Power Save in File menu.
  2. Checking basic complete and smart type completion in IDE settings (editor)
  3. Invalidate caches and restart.

But non of these seems to work.

aga
  • 27,954
  • 13
  • 86
  • 121
  • 1
    I am having same trouble, even after doing all these and pressing ctrl+space multiple times the suggestions come for a second and get vanish. – abby37 May 03 '18 at 07:44
  • https://stackoverflow.com/a/53388983/5452338 follow this link. it's work for me. – Sahan Dec 27 '18 at 10:43

7 Answers7

4

Try with CTRL + space and you will get the drop down .

Subhalaxmi
  • 5,687
  • 3
  • 26
  • 42
4

I had the same issue and solved it. Go File> Invalidate Caches / Restart... > Click at Invalidate and Restart

Then you can also check if Power Save Mode on File menu is disabled.

Source: Android Studio - Auto complete and other features not working

Community
  • 1
  • 1
Andrés Marafioti
  • 819
  • 1
  • 7
  • 23
4

These following steps are working for me:

  1. Close android studio
  2. Go to path/.AndroidStudio3.5/system/ delete caches folder
  3. Start Android Studio
mili2501
  • 452
  • 5
  • 9
1

You should Try this way File->Invalidate Caches/Restart or you can find solution by using below link

https://stackoverflow.com/a/58214439/11404883

Dharman
  • 30,962
  • 25
  • 85
  • 135
Aamil Silawat
  • 7,735
  • 3
  • 19
  • 37
1

In my case on Android Studio Artic Fox edition there were strange problems with autocompletion and suggestions because of old version of Gradle plugin. I have updated to

    classpath 'com.android.tools.build:gradle:4.1.1'
    classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.4.21'

and it worked as expected. Hope it will be helpful for new visitors like in my case it would.

Arkadiusz Cieśliński
  • 5,307
  • 3
  • 23
  • 19
0

In Ubuntu 21 I had tried $ rm -rf ~/.cache/Google/AndroidStudio2020.3/caches/

I followed all the steps from various answers and sources, still didn't get it to work. Code completion and Syntax Highlighting was not working. I restarted using Invalidate Caches and did Gradle Sync atleast 10 times.

It was working in main flavor, but not in other flavors! In this project we have multiple flavors.

So finally the solution was found using Android Studio product flavors only recognized one out of two flavours

Just selecting the correct Build Variant solved my issue.

k007sam
  • 36
  • 3
  • Your answer is good, but you should try using formatting correctly. For eg. Syntax Highlighting doesn't need to be in a code block. – JustinW Oct 22 '21 at 05:51
0

Delete everything inside caches folder

C:\Users\<user_name>\AppData\Local\Google\AndroidStudio<version_x>\caches

and restart android studio

minato
  • 2,028
  • 1
  • 18
  • 30