Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: cannot resolve appcompat-v7 themes

In themes.xml, I would like to change a theme from Theme.Holo.Light.DarkActionBar to Theme.AppCompat.Light.DarkActionBar

but I get:

cannot resolve symbol '@android:style/Theme.AppCompat.Light.DarkActionBar'

In the gradle file I added:

compile 'com.android.support:appcompat-v7:22.1.1'

I am using:

compileSdkVersion 22
buildToolsVersion "22.0.1"

I have also run gradle's clean command, but nothing seems to change.

Any ideas?

like image 954
Daniele B Avatar asked May 08 '15 23:05

Daniele B


1 Answers

The AppCompat themes are not part of the built-in styles. You have to reference them without the '@android:style' prefix.

Just use something like:

<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
like image 168
ebarrenechea Avatar answered Sep 28 '22 01:09

ebarrenechea