IDE "Cannot Resolve @style/Theme.Appcompat" when using v7 compatibility support theme

I had this same issue. Sounds like you have the V7 jar file compiling fine but you are probably missing the xml resource needed.You need to manually include the 'Theme.xml' provided with the V7 package. Here is what I did to fix it.

Look under:Adding libraries with resources http://developer.android.com/tools/support-library/setup.html

The directions provided here aren't very clear because it doesn't tell you to bring any resources in. (maybe a bug in Android Studio?)

Here is what I did:

  1. Update your SDK in the manager and be sure to include 'Android support repository' in extra's
  2. Go to SDK in file explorer (Finder on mac) track down the extra's folder (..\sdk\extras\android\support\v7\appcompat\res\values on Windows). Somewhere in there is a "themes.xml" and "themes_base.xml'. Copy both of these files.
  3. In your project paste the files into 'values' directory
  4. do a rebuilt and that did the trick for me.

I changed from:

classpath 'com.android.tools.build:gradle:+'

to:

classpath 'com.android.tools.build:gradle:2.2.3'

and now it's working!


This problem was fixed in Android Studio v0.2.7.

  • https://code.google.com/p/android/issues/detail?id=56312
  • https://android-review.googlesource.com/#/c/64533/