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

后端 未结 25 1658
情深已故
情深已故 2020-12-07 18:39

I\'m trying to figure out why the heck my Android studio isn\'t recognizing the AppCompat v7 library correctly. The import statement below shows up as gray and says there\'s

25条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-07 18:53

    If you have already tried

    1. Invalidating caches and restarting
    2. Cleaning/rebuilding the project
    3. ./gradlew clean assemble
    4. added implementation
      "com.android.support:support-v4:23.1.1"
      "com.android.support:appcompat-v7:23.1.1"
      "com.android.support:support-annotations:23.1.1"
    5. Corrected import to android.support.v7.app.AppCompatActivity;
    6. Corrected any existing androidx imports

    Still facing issue then please read below

    Finally found the solution

    I tried everything mentioned in all the answers and failed.

    Go to gradle.properties make these flags false

    android.useAndroidX=false

    //Automatically convert third-party libraries to use AndroidX

    android.enableJetifier=false

    The above flags were

    "true ,for me and hence gradle won't download v7 components"

提交回复
热议问题