2015-10-26 61 views
0

我嘗試在我的項目中添加'com.android.support:design:22.2.0'。但我有錯誤「屬性」rippleColor「已被定義」。它向我展示了values.xml的路徑,其中屬性發生在哪裏。它在Mike Penz圖書館的「MaterialDrawer」中。但有一個問題,這個values.xml沒有「rippleColor」的任何屬性。也許它有一些Gradle或其他的bug?如何解決這個問題? P:當我創建新項目並添加這兩個庫(appcompat:design和com.mikepenz:materialdrawer:3.1.2)時,它的工作很好。錯誤:(1)屬性「rippleColor」已經在android studio中定義

+0

http://stackoverflow.com/questions/31183193/gradle-error-attribute-ripplecolor-has-already-been-defined-in-android-stud –

+0

「...這個values.xml沒有任何具有「rippleColor」屬性的屬性「 –

+0

您正在使用具有相同attrs的依賴項。檢查attrs.xml文件。 –

回答

1

這個google search!你可以找到:


看來,在項目使用的是(自己的應用程序+使用的庫)命名rippleColor屬性使用至少兩次。

我建議檢查你的XML包含的顏色或任何屬性(例如colors.xml,或任何其他,嘗試在您的IDE中的整個項目中搜索它)。

檢查提到的rippleColor是否被多次使用。如果你的項目中有它,請重命名它!


Example:

1 - 谷歌播放服務

compile 'com.google.android.gms:play-services:7.8.0' 

2-設計支持庫

compile 'com.android.support:design:22.2.0' 

3-質感設計

compile 'com.github.navasmdc:MaterialDesign:[email protected]' 

Fix this issue

首先來解決這個問題,請更換谷歌播放服務包(全包),你需要特定的一個,請查看google site在谷歌錢包有屬性叫rippleColor,在我的情況,我需要谷歌地圖com.google.android.gms:play-services-maps:7.8.0

可以用compile 'it.neokree:MaterialNavigationDrawer:1.3.2'替代設計支持庫compile com.github.navasmdc:MaterialDesign:[email protected],如果你需要使用的導航抽屜僅

我希望THI s幫助

+0

太棒了!謝謝! – Pierry