skip to Main Content

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?

enter image description here

5

Answers


  1. after clean the project sync the build gradle or cut and paste a one dependency and sync the gradle

    Login or Signup to reply.
  2. Most probably, you might have been using androidx libraries.
    Try androidx.appcompat.widget.AppCompatTextView

    instead of
    <TextView

    Login or Signup to reply.
  3. 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 🙂

    Login or Signup to reply.
  4. 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))

    Login or Signup to reply.
  5. I solved this error by set Gradle user home :
    1.File -〉Project Structure -〉SDK Location -〉Gradle Setting -〉Gradle user home (select your local)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search