Skip to content Skip to sidebar Skip to footer

Ide "cannot Resolve @style/theme.appcompat" When Using V7 Compatibility Support Theme

This is not really a huge issue, as my project still builds and runs correctly (using gradle), but I'm having trouble getting Android Studio to recognize the application compatibil

Solution 1:

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 resourceshttp://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.

Solution 2:

I changed from:

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

to:

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

and now it's working!

Solution 3:

Solution 4:

Filip Cvejic's answer is useful. My android studio version is 1.3.1, has the same issue. It works after add one line "compile 'com.android.support:appcompat-v7:23.0.0'" as following:

   dependencies {
        compile"com.android.support:support-v4:23.0.0"compile"com.android.support:support-v13:23.0.0"compile"com.android.support:cardview-v7:23.0.0"compile'com.android.support:appcompat-v7:23.0.0'
    }

Solution 5:

Don't add the library to the Java Build Path, add the library (as a project) in Settings>Android>Libraries>Add Library.

Post a Comment for "Ide "cannot Resolve @style/theme.appcompat" When Using V7 Compatibility Support Theme"