I just changed my Laptop, downloaded Android Studio Arctic Fox and cloned the project on which I was already working on in my previous machine. I see that few of the tags are not imported and are in red in the xml layout. When I hover over it, it says "Cannot resolve class TextView". Similar issue with ImageView. What is wrong?
Question posted in Android Studio
The official documentation can be found here.
The official documentation can be found here.
5
Answers
after clean the project sync the build gradle or cut and paste a one dependency and sync the gradle
Most probably, you might have been using androidx libraries.
Try
androidx.appcompat.widget.AppCompatTextView
instead of
<TextView
I also facing the same problem for 2 days, try lots of the way but didn’t work. But a few minutes ago I just update my Glradle to the
classpath ‘com.android.tools.build:gradle:7.0.1’
and boom it’s solved my problem. You can try this 🙂
This error but made a struggle 3 days; I solved it by upgrading gradle to the latest version on this day gradle: 7.0.3 at the classpath level (build.gradle (project))
I solved this error by set Gradle user home :
1.File -〉Project Structure -〉SDK Location -〉Gradle Setting -〉Gradle user home (select your local)