10

I can't get any suggestion from my xml layout file. What must I do to fix the problem?

I have tried to invalidate/restart Android studio, enable and disable, deleting build folder, .idea folder, .iml file, and I have tried to make a new project but the suggestion still not show up.

enter image description here

I just want to show suggestion like before normally.

enter image description here [EDIT]

And every time i select TextView or EditText the element not making layout_width and height automatically.

enter image description here

How I Solved It!

Everybody maybe had a different way of solving this problem. But for me after doing so many experiments, the last thing I do is going to delete configuration setting for Android Studio on "C:\Users\.AndroidStudio" then all fixed for me.

Nanda R.M
  • 203
  • 2
  • 3
  • 13
  • Most of the times the problem is that Power Save Mode is enabled, to disable go to Current inspection profile (lower right corner in Android Studio).@Nanda R.M stikom – Asteroid Feb 12 '19 at 08:13
  • 2
    Android Studio Chipmunk breaks with `compileSdk 33`, but updating to Dolphin or above fixes it. – EpicPandaForce Sep 02 '22 at 04:29

16 Answers16

12

Have the same issue, delete caches, invalidate caches or disable power mode is not work for me

I change compileSdk from 33 to 30

and it's work

I use Android studio chipmunk | 2021.2.1 Patch 1

Maybe new feature still not work properly or something. If anyone can explain this will be very helpfull

9

I have tried different things(deleting .idea folder and .iml files from the project, invalidate cache and restart the Android Studio) nothing worked.

Finally I close the Android Studio and navigate to android studio installation directory(i.e C:\Users\Your Username\.AndroidStudio3.3\system) delete the Cache folder, run the android studio and it's works for me.

Zahoor Saleem
  • 614
  • 7
  • 15
5

Please change the compileSdkVersion to 32. It worked for me.

Ajay Gowtam
  • 106
  • 1
  • 4
4

Normally, you will not get suggestions until your project is rightly indexed. So before the indexing is complete, you will see this problem. Once the indexing of files is complete, you should be able to see the suggestions.

However, if the indexing is complete and you still do not get the suggestion, I would like to recommend to install the latest version of Android Studio again and do not import any settings from your previous version.

You can also try looking for if the Power Saving Mode and invalidating the cache. This post addresses the same issue I think where you might have a look as well.

Reaz Murshed
  • 23,691
  • 13
  • 78
  • 98
  • The second image was my entire project, as u can see there is no indexing process there. And yes now im trying to update my AS and nothing change. Thanks for the answer – Nanda R.M Feb 12 '19 at 08:12
  • I see, can you please try the options mentioned in the link that I have posted? – Reaz Murshed Feb 12 '19 at 08:13
  • Yes i already try that before asking. my power saving mode is not enable from beginning. and i try to enable and disable again still nothing happen T-T. – Nanda R.M Feb 12 '19 at 08:16
  • Absolutely, nothing wrong than suggestion :D. i'm not getting problem like this before and i'm not changing anything to the project. should i restart my PC ? – Nanda R.M Feb 12 '19 at 08:23
  • LOL. That's weird. You might try that as well I think. :P – Reaz Murshed Feb 12 '19 at 08:29
  • Thanks for help, and sorry i'm not active for a few days maybe :D. I fix it little different, after doing so much experiments, the last thing i do is going to delete configuration setting for Android Studio on "C:\Users\\.AndroidStudio" then all fixed. But i ll chose ur answer as accepted answer. Sorry my english bad ;v – Nanda R.M Feb 22 '19 at 00:50
4

First solution

Deleting the .idea folder and all .iml files from the project, restarting Android Studio and rebuilding a gradle did the trick. Autocomplete in XML support library is working again.

Second Solution

Just navigate to your android studio installation directory: your_drive_path:/.AndroidStudio3.4/system

Inside system folder: DELETE CACHE FOLDER

user16217248
  • 3,119
  • 19
  • 19
  • 37
Patel Vijay
  • 222
  • 2
  • 3
4

1- close the android studio entirely.

2- Open File explorer and go to:
C:\Users\Username\.AndroidStudio3.5\system.

3- Now delete the Caches folder.

4- Run the android studio.

5- After indexing it will work.

Digital Farmer
  • 1,705
  • 5
  • 17
  • 67
Adnan
  • 171
  • 2
  • 4
4

Change the compile sdk version to

compileSdk 32

and also for kotlin

implementation 'androidx.core:core-ktx:1.8.0'
Muhaiminur Rahman
  • 3,066
  • 20
  • 27
1

I change compileSdk from 33 to 32 then its work for me

0

First Close Android Studio. Navigate to the Installation Directory. i.e. .AndroidStudio3.3\system Delete Cache Folder . Start Android Studio. It is supposed to Work.

Karthick Ramesh
  • 1,451
  • 20
  • 30
0

With Android Studio closed go to the Path C/Users/you_user/AndroidStudio3.6\system and delete the content of caches

Eli
  • 27
  • 2
0

Go to path/.C:\Users\Hp.AndroidStudio4.0\system/ delete caches folder

and restart android studio

0

100 % working solution

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.

Disabling Power Save in File menu. Checking basic complete and smart type completion in IDE settings (editor) Invalidate caches and restart. But non of these seems to work.

These following steps are working for me:

Close android studio Go to path/.AndroidStudio3.5/system/ delete caches folder Start Android Studio ,

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

If none of work :

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

Cashpi App
  • 11
  • 3
0

Invalidate caches... did not work for me

Clean Project, and Rebuild Project... did not work for me

But changing module level gradle's

compileSdk to 31, and targetSdk to 31

did work for me!

I guess some issues with SDK version 33

Vivek
  • 566
  • 5
  • 6
0

I tried all, Invalidate Cache, Restart, Clean, and rebuild the project. Downgrading from SDK 33 to 30 also I did after searching. Nothing worked.

In the end, I updated my Android Studio from Chipmunk to Dolphin. Everything is sorted now.

So the final conclusion that worked for me is: Update the Android Studio

Sachin Harne
  • 175
  • 2
  • 14
0

Check that you have in app build.gradle -> implementation 'androidx.legacy:legacy-support-v4:1.0.0'

Me help it

Boo
  • 1
0

in my case it has been solved by decreasing compileSdk and targetSdk to version 31 and then Ive changed some of dependencies versions for example :

implementation androidx.core:core-ktx:1.8.0 implementation androidx.appcompat:appcompat:1.4.2 implementation com.google.android.material:material:1.6.1 implementation androidx.constraintlayout:constraintlayout:2.1.4 testImplementation junit:junit:4.13.2 androidTestImplementation androidx.test.ext:junit:1.1.3 androidTestImplementation androidx.test.espresso:espresso-core:3.4.0

notice that my android gradle plugin version :7.2.1 Gradle Version :7.3.3