2016-09-06 7 views
3

属性(オリジナル属性は、ここで定義された)

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

を追加した後、プロジェクトをビルドすることはできませんが、次のエラーを与えてキープ:問題がある、のような

らしいですベクトル描画可能なものをサポートしています。いくつかの属性が何度か追加されます。

は、例えば、内蔵されvalues.xmlファイルが含まれています:

<declare-styleable name="AppBarLayout_LayoutParams"><attr name="layout_scrollFlags"><flag name="scroll" value="0x1"/><flag name="exitUntilCollapsed" value="0x2"/><flag name="enterAlways" value="0x4"/><flag name="enterAlwaysCollapsed" value="0x8"/></attr><attr format="reference" name="layout_scrollInterpolator"/></declare-styleable> 

<declare-styleable name="AppBarLayout_Layout"><attr name="layout_scrollFlags"> 
     <flag name="scroll" value="0x1"/> 
     <flag name="exitUntilCollapsed" value="0x2"/> 
     <flag name="enterAlways" value="0x4"/> 
     <flag name="enterAlwaysCollapsed" value="0x8"/> 
     <flag name="snap" value="0x10"/> 

が、私はこのファイルをGradleのために追加しました:

compile 'com.android.support:cardview-v7:24.2.0' + '@aar' 
compile 'com.android.support:recyclerview-v7:24.2.0' + '@aar' 
compile 'com.android.support:appcompat-v7:24.2.0' 
compile 'com.android.support:design:24.2.0' 
+0

@aarを削除してください。 –

+0

接続が見つかりませんでしたが、引き続き削除して確認しました。これは問題ではありません – Javanshir

+0

このエラーが表示されるlayout.xmlを入れてください –

答えて

2

問題は、異なるバージョンが表示されますアプリケーション内に存在する同じライブラリのこの場合、異なるバージョンのサポートライブラリ。

あなたのgradleファイルに表示されていない場合は、おそらく依存関係として追加されます。各ライブラリの依存関係を確認するために、ターミナルで次のように実行します。

./gradlew app:dependencies 

次に、あなたに合ったものは何でも、APPCOMPATと更新の古いバージョン/削除を使用するライブラリを見つけます。

0

あなたは、Android SDKは、拡張attributes.Useまで親の名前空間に回避していない他のコントロールと同じプロパティ名を持っており、カスタムコントロールのプロパティの名前を変更

<declare-styleable name="MyBgView"> 
     <attr name="textString" format="string" /> 
     <attr name="textSizes" format="dimension" /> 
     <attr name="triangleSize" format="dimension" /> 
     <attr name="backgrounds" format="color" /> 
     <attr name="textColors" format="color" /> 

0

<declare-styleable name="AppBarLayout_Layout" parent="AppBarLayout_LayoutParams"> 
    <attr name="layout_scrollFlags"> 
</declare-styleable> 
関連する問題