Android studio XML autocomplete not working properly

Solution 1:

It is very simple. Delete .caches file:

For Android Studio 4+

  1. Just close your AS.
  2. Go to AndroidStudio2020.3 folder.
  3. Delete the Caches file (path is: C:\Users\user\AppData\Local\Google\AndroidStudio2020.3\caches)
  4. Restart your AS.
  5. Enjoy.

For Android Studio 3+

if you are using Android Studio 3+ then delete cache from the following path

C:\Users\user\AndroidStudio3.x\system\caches

Solution 2:

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 works for me.