Cannot resolve symbol AppCompatActivity – Support v7 libraries aren’t recognized?

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

Cannot resolve symbol ‘AppCompatActivity’

A little addition to other answers here, for anyone having the same error while using the right lib version and the right class. When I upgraded to In which ActionBarActivity is deprecated and empty and AppCompatActivty is the way to go, due to some glitch in Android Studio, It didn’t quite pick up on version change. i.e. Even though … Read more

“Field can be converted to a local variable” message appearing when setting Android ActionBar colour

What the warning is telling you is that actionBarColor shouldn’t be a global variable (i.e. a field), because it’s only used in one method (onCreate). This is good advice: you should always minimize the scope of your variables, because it improves readability and reduces possibilities for programming errors. To get rid of the warning, fix the problem … Read more

Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat

Run gradle -q dependencies (or gradle -q :projectName:dependencies) to generate a dependency report. You should see where r7 is coming from, such as: Then, use the exclude directive to block that dependency. In my case, it is coming from my CWAC-Camera library, and so I use: (where the second compile statement indicates what version you … Read more