I'm experimenting with my first "Hello World"-like application in Android Studio. I've tried to add a new activity (first via New -> Android Component, didn't like the result, deleted it, then via New -> Activity -> selected Fullscreen activity). Now I get these errors:
Gradle: Execution failed for task ':LanguagesMemorizer:processDebugResources'.
> Could not call IncrementalTask.taskAction() on task ':LanguagesMemorizer:processDebugResources'
C:\...\src\main\res\values\attrs.xml
Gradle: Attribute "buttonBarStyle" has already been defined
Gradle: Attribute "buttonBarButtonStyle" has already been defined
I've tried searching for buttonBarStyle in my project. It was found in:
<declare-styleable ...> <attr name="buttonBarStyle" format="reference" /> ...
)<style...>... <item name="buttonBarStyle">@style/ButtonBar</item>...
)<style...>...<item name="buttonBarStyle">?android:attr/buttonBarStyle</item>...
)All of it was auto-generated. How should I fix this error?
UPDATE: There is a comment in attrs.xml which says
<!-- Declare custom theme attributes that allow changing which styles are
used for button bars depending on the API level.
?android:attr/buttonBarStyle is new as of API 11 so this is
necessary to support previous API levels. -->
So it seems like these attributes are needed for old Androids, but so I guess there is some sort of a conflict between API 11-declared attributes and these manual attributes. How should I fix them?
This is because com.android.support:appcompat-v7:18.0.0
already has this attribute. So if you plan to use this support library (and you should) it is safe to just delete declaration of this attributes from your project \src\main\res\values\attrs.xml
. I guess, this duplication is because AndroidStudio new activity wizard, doesn't suppose that you can use support library so it generates all code by itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With