Lollipop AppCompat-v7 21 - Attribute "theme" has already been defined

user3184899 picture user3184899 · Oct 17, 2014 · Viewed 25k times · Source

I wanted to upgrade my project to support Android Lollipop and API 21, so I changed AppCompat version at the dependencies to 21.0.0, and my target SDK to 21.

But now, When I'm trying to sync project with gradle files, it gives me 102 errors that weren't there before:

1 error of "Attribute 'theme' has already defined" - given by my colors.XML file,

and another 101 errors of "no resources found that matches the given name..." - most of them are Material ones - given by "build/intermediates/exploded-aar/com.android.support/appcompat-v7/21.0.0/res/values-v11/values.XML".

Already updated all SDK tools in Android SDK software, Using Android Studio 0.8.9 Beta.

Can anyone help? Thanks.

Answer

tilal6991 picture tilal6991 · Oct 17, 2014

I had the first issue as well. It can be fixed by updating the Google Play Services dependency to 6.1.+.

In Gradle (which I hope you are using) this is: compile 'com.google.android.gms:play-services:6.1.+'

As for the second issue - as people have said in the comments, you should make sure ALL the components in your SDK installation are up to date.