Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android studio doesn't suggest import

Android studio is failing to suggest imports for known classes, like Date and List and so on. Just warns "Cannot resolve symbol"

Android Studio 2.2.3
Build #AI-145.3537739, built on December 2, 2016
JRE: 1.8.0_76-release-b03 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o

Note: Auto import is enabled, and there are no excluded classes from it, manually adding the import statement works.

like image 966
aclowkay Avatar asked Feb 03 '26 07:02

aclowkay


1 Answers

It should automatically import (atleast in 2.2.2).Try this if it does not, Select the red coloured text ( the symbols which can't be resolved) and press Ctrl+i . This will import the required.

If this does not work go to File-> Invalidate caches/Restart.

Auto import not working for Android classes in Android studio

like image 107
Sivagami Nambi Avatar answered Feb 05 '26 21:02

Sivagami Nambi