Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle can't resolve AppCompat themes

I have imported appcompat library through:

dependencies {
  compile fileTree(dir: 'libs', include: ['*.jar'])
  compile 'com.android.support:appcompat-v7:+'
  compile 'com.android.support:support-v4:+'
}

in my {ProjectName}/{ModuleName}/build.gradle. The library shows up in external libraries. Yet, I can't build the app because when I try, there's an error in my styles.xml:

Error:Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light'

This is where I declare a theme to derive from AppCompat theme, like this:

  <style name="TextStyleSuperClass" parent="@style/Theme.AppCompat.Light">
  </style>

Do you know how to fix this?

like image 662
Bigos Trismegistos Avatar asked Nov 10 '22 06:11

Bigos Trismegistos


1 Answers

On this site "Getting ActionBar support library working with Android Studio" I'v found the following line and added it to the activity in the AndroidManifest.xml:

android:theme="@style/Theme.AppCompat.Light"

From that on Android Studio was able to resolve Theme.AppCompat

like image 176
Dirk Avatar answered Nov 15 '22 06:11

Dirk