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:
Anybody know of any fixes? It's cost me a lot of time and it's really frustrating.
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