2017-10-15 26 views
3

クールな設定作業を作成したいと思います。 しかし、私は私のbuild.gradleに依存を書くとき、私は、ライブラリのバージョン(たバージョン25.3.1および23.4の混合」について依存関係の問題

を警告している。だから私は(https://github.com/codevscolor/MaterialPreferenceこれを仮定)githubのから多数のライブラリのいずれかを選択します。 0)すべて ライブラリはまったく同じバージョンの仕様」

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support:support-v4:25.3.1' 
    compile 'com.android.support:design:25.3.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7' 
    testCompile 'junit:junit:4.12' 
    compile 'de.hdodenhof:circleimageview:1.3.0' 
    //it's dependency for new great library 
    compile 'com.codevscolor.materialpreference:mp:0.2.1' 
} 

このエラーを回避する方法はありいを持っている必要がありますか?

全build.gradleはここにある:

ライブラリ com.codevscolor.materialpreference:mp:0.2.1はバージョンサポートライブラリの 25.4.0を使用しているので起こり
apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.2" 
    defaultConfig { 
     applicationId "com.example.parkfinder" 
     minSdkVersion 23 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 
    } 
    buildTypes { 
     release { 
      minifyEnabled false 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    compile 'com.android.support:appcompat-v7:25.3.1' 
    compile 'com.android.support:support-v4:25.3.1' 
    compile 'com.android.support:design:25.3.1' 
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7' 
    testCompile 'junit:junit:4.12' 
    compile 'de.hdodenhof:circleimageview:1.3.0' 
} 
+1

としてあなたbuild.gradleを更新して[OK]をクリックして、フル 'build.gradle' –

+0

を示しました。質問の最後に書きます –

+0

それがうまくいかない場合、あなたのプロジェクトを掃除してみてください。キャッシュ/再起動を無効にします。 –

答えて

1

てみ

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
    exclude group: 'com.android.support', module: 'support-annotations' 
}) 
compile 'com.android.support:appcompat-v7:25.3.1' 
compile 'com.android.support:preference-v7:25.3.1' 

compile 'com.android.support:support-v4:25.3.1' 
compile 'com.android.support:design:25.3.1' 
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha7' 
testCompile 'junit:junit:4.12' 
compile 'de.hdodenhof:circleimageview:1.3.0' 
//it's dependency for new great library 
compile 'com.codevscolor.materialpreference:mp:0.2.1' 
} 
+0

ありがとうございます)ありがとう –

0

。 その依存関係を使用するには、サポートライブラリを25.3.1から25.4.0にアップグレードする必要があります。

だから、あなたのケースで:

compile 'com.android.support:preference-v7:25.3.1' 

を追加

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 
     exclude group: 'com.android.support', module: 'support-annotations' 
    }) 
    // Upgrade the support dependencies to 25.4.0 
    compile 'com.android.support:appcompat-v7:25.4.0' 
    compile 'com.android.support:support-v4:25.4.0' 
    compile 'com.android.support:design:25.4.0' 
    // Move it from alpha to the latest stable version. 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    testCompile 'junit:junit:4.12' 
    compile 'de.hdodenhof:circleimageview:1.3.0' 
    //it's dependency for new great library 
    compile 'com.codevscolor.materialpreference:mp:0.2.1' 
}