2015-08-09 73 views
1

我想使用MaterialDesignSupport lib和MaterialDesignLib(Github上) 在同一個項目屬性「rippleColor」已被定義

搖籃Dependcies:

dependencies { 
    compile fileTree(include: ['*.jar'], dir: 'libs') 
    compile 'com.github.navasmdc:MaterialDesign:[email protected]' 
    compile 'com.android.support:design:22.2.0' 
    compile files('MaterialDesign/libs/nineoldandroids-2.4.0.jar') //that jar was missing from some reason 
} 

,但我得到Error:(1) Attribute "rippleColor" has already been defined。 根據this answer attr rippleColor在項目中多次提到,我應該重命名它,但包含attr的文件位於內置文件夾下並且每次都會重新生成,因此我無法重命名它。有沒有辦法重新命名建立的文件或任何方式來解決這個問題?

回答

0

在您的應用中,您有2個不同的rippleColor定義,因此您無法編譯它,因爲定義可能在您使用的不同庫中生成。

我看到解決這個問題的唯一方法是從一個庫中複製需要的代碼,並避免複製rippleColor定義。

0

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

compile 'com.github.vajro:MaterialDesignLibrary:1.6'

,並添加

repositories { 
    maven { url "https://jitpack.io" } 
} 

注: 上述GitHub庫是其中rippleColor屬性已更名的https://github.com/navasmdc/MaterialDesignLibrary分支版本作爲mRippleColor

或者將原始的repo克隆到桌面(或某處)並編輯屬性並使用它。

相關問題