Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 no package for support.v7.app. Below is my activity file:

import android.support.v7.app.AppCompatActivity;   public class XApplicationActivity extends AppCompatActivity 

My build.grade:

compile "com.android.support:appcompat-v7:22.0.0" compile "com.android.support:support-annotations:$ANDROID_SUPPORT_VERSION" compile "com.android.support:support-v4:$ANDROID_SUPPORT_VERSION" 

My project settings:

minSdkVersion = 14 targetSdkVersion = 21 compileSdkVersion = 21 buildToolsVersion = "22.0.1" 

So I'm really confused as to why this is still giving me issues. Things I've tried already:

  • Cleaning/rebuilding the project
  • Invalidating caches and restarting
  • Checking a billion times to make sure I have the support library installed (I absolutely do have the latest support repository and libraries installed)

Anybody know of any fixes? It's cost me a lot of time and it's really frustrating.

like image 343
hendersawn Avatar asked Jun 12 '15 12:06

hendersawn


1 Answers

For me, Even after upgrading to appcompat-v7:22.1.0, in which AppCompatActivty is added, the problem was not resolved for me, Android Studio was giving same problem

Cannot resolve symbol 'AppCompatActivity'

Sometimes clearing the android studio caches help.

In android studio I just cleared the caches and restarted with the following option--

File->Invalidate Caches/Restart

like image 162
Nicks Avatar answered Oct 13 '22 06:10

Nicks