xml - Trouble getting Gradle to build Android L "Error: Found item Style/AppTheme more than one time" -



xml - Trouble getting Gradle to build Android L "Error: Found item Style/AppTheme more than one time" -

i trying create android app using android l sdk version. however, when trying build project using gradle, run next error:

"error: found item style/apptheme more 1 time"

which points res/values-v21/styles.xml

i know in res/values/styles.xml there style "apptheme" defined, far know next android developers guide on using android l. perhaps can help me:

here my:

build.gradle

apply plugin: 'com.android.application' android { compilesdkversion 'android-l' buildtoolsversion '20.0.0' defaultconfig { applicationid "com.mayuonline.ribbit" minsdkversion 'l' targetsdkversion 'l' versioncode 1 versionname "1.0" } buildtypes { release { runproguard false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:support-v4:20.+' }

androidmanifest.xml

<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="resume.kelseyhrubes" > <uses-sdk android:minsdkversion="l" android:targetsdkversion="l"/> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name=".mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application> </manifest>

values/styles.xml

<resources> <!-- inherit material theme --> <style name="apptheme" parent="android:theme.material"> <!-- main theme colors --> <!-- app branding color app bar --> <item name="android:colorprimary">@color/primary</item> <!-- darker variant status bar , contextual app bars --> <item name="android:colorprimarydark">@color/primary_dark</item> <!-- theme ui controls checkboxes , text fields --> <item name="android:coloraccent">@color/primary_light</item> </style> </resources>

values-v21/styles.xml

<?xml version="1.0" encoding="utf-8"?> <resources> <style name="apptheme" parent="android:theme.material.light"> </style> <style name="apptheme">@color/primary @color/primary_dark @color/primary_light </style> </resources>

i apologize bad formatting, hope readable. if knows doing wrong, please allow me know. want create app sweetness material design.

you should not using l anymore, preview sdk need utilize 21 utilize official sdk

android xml android-studio android-gradle android-5.0-lollipop

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -