Android.Support.V7.App.Activitycompat Not Found not found

It seems the ActivityCompat class is no longer in the class. I had to change my import to However for AppCompatActivity and AlertDialog I can use v7.

Cannot resolve symbol 'ActivityCompat' and 'content'

You have to use androidx classes:

Add the dependency:

implementation "androidx.core:core-ktx:+"

and change your import:

import -> import
import -> import androidx.core.content.ContextCompat

Also remove in your build.gradle the support libraries dependencies:

//implementation ''
//implementation ''
//implementation ''

How to fix cannot access ActivityCompat class file for not found error in android?

If you are not added the support library, please add support library


Add the following line to your app/build.gradle file:

implementation ''

replace the YOUR_TARGET_VERSION with your target version,

implementation ''

And rebuild the project.

Cannot resolve symbol AppCompatActivity - Support v7 libraries aren't recognized?

Okay, I fixed it by rebuilding it for doing a ./gradlew clean assemble for the fourth time... Android Studio is a weird thing

ionic capacitor build cannot find symbol

This can be fixed by running:

npm install jetifier
npx jetify
npx cap sync android

... which changed the import reference from:





Cannot Resolve symbol ActivityCompat

Try Using this,

compile ''

Can not resolve symbol annotation design ActivityCompat v7

Thanks everyone for the answers.

As it turns out, during project setup time I used the "basic activity" as a template for fast setup. But I later realized in the "basic activity" in newer version of Android Studio uses AndroidX instead of Android Suppor library. And all my code is based on the legacy android library.

In the file file(located in the base directory of your project same as gradlew), change




If you have all the dependency right and rebuild and cleared cache several times, still the android support library doesn't work. And if you have a newer version of android studio. It's possible that are wrong.

The Import cannot be resolved

  1. Go to your project in the navigator, right click on properties.

  2. Go to the Java Build Path tab on the left.

  3. Go to the libraries tab on top.

  4. Click add external jars.

  5. Go to your ADT Bundle folder, go to sdk/extras/android/support/v7/appcompat/libs.

  6. Select the file android-support-v7-appcompat.jar

  7. Go to order and export and check the box next to your new jar.

  8. Click ok.

Related Topics

Leave a reply