I am working on a project in Android studio. Suddenly, auto import stopped working in android studio for Android classes, like Android.widgets.Textview, etc. In my settings, auto import is enabled. If I write import android.widget.textview, then TextView shows up in the auto import box.
The problem was with android studio indexing.
Follow the steps..
Go to 'File' > 'Invalidate caches/restart'
Now the studio will shut down and restart. Now indexing begins. On completion of indexing you will find the Suggestion boxes with every possible suggestions.
For me, the problem was that "Show import popup" was not checked at File > Settings > Editor > General > Auto Import > Java.
For me the reason was that the class I tried to create did not have an explicit public keyword, which made the class private by default, so it didn't show up in the import context menu of android studio.
For me, the problem was that Gradle targetSdkVersion 30 and compileSdkVersion 30. I changed that at targetSdkVersion 31 and compileSdkVersion 31. And works again. I have tried two days to resolve this issue. And voilà!
For me, the problem was missing lines in to build.gradle (app)
plugins {
id 'kotlin-android-extensions'
}
I have same problem here, in my case I think it happen because i forced renaming my flutter projects. And unfortunetly when i realize, i forgot the actual name before i renaming.
But it solve by push to git, then download again the project, reopen with android studio. Voila, it solve. It may stupid way to solve, but it work.
I think it happen because Android studio generated file in project to save setting for each project. But after i rename my folder, the connection between apps and setting file is broken.
For me the problem was that Power Save Mode was on for some weird reason.
Solution:
Disable "Power Save Mode" in Android Studio menu: File->Power Save Mode
© 2022 - 2024 — McMap. All rights reserved.