Issue
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.
Solution
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
Answered By - Sivagami Nambi
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.