2017-07-12 63 views
1

我在的build.gradle(模塊應用程序)的問題,我解決不了所有com.android.support庫必須使用相同的版本規格

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion "25.0.3" 
    defaultConfig { 
     applicationId "ahmedchtn.smartschool" 
     minSdkVersion 17 
     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' 
    }) 

    //RecyclerView 

    //retrofit,gson 

    //glide 
    compile 'com.github.bumptech.glide:glide:3.7.0' 

    //Displaying images 
    compile 'com.github.bumptech.glide:glide:3.7.0' 

    compile 'com.android.support:appcompat-v7:23.4.0' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.android.support:support-v7:25.0.3' 
    compile 'com.android.support:design:25.3.1' 
    compile 'com.android.support:recyclerview-v7:25.3.1' 
    compile 'com.google.code.gson:gson:2.6.2' 
    compile 'com.squareup.retrofit2:retrofit:2.0.2' 
    compile 'com.squareup.retrofit2:converter-gson:2.0.2' 
    compile 'com.google.firebase:firebase-database:10.0.1' 
    compile 'com.google.firebase:firebase-auth:10.0.1' 
    //Firebase UI 
    compile 'com.firebaseui:firebase-ui-auth:0.6.0' 

    testCompile 'junit:junit:4.12' 
} 
apply plugin: 'com.google.gms.google-services' 

顯示在此行中的錯誤

compile 'com.android.support:appcompat-v7:23.4.0' 

錯誤消息:

All com.android.support libraries must use the exact same version specification(mixing versions can lead to runtime crashes).Found versions 25.3.1,23.4.0.Examples include 
com.android.support:animated-vector-drawable:25.3.1 and 
com.android.support:cardview-v7:23.4.0 
+0

是否有任何理由不使用'compile'c​​om.android.support:appcompat-v7:25.3.1''來避免衝突? – Siu

+0

[所有com.android.support庫必須使用完全相同的版本規範]的可能副本(https://stackoverflow.com/questions/42374151/all-com-android-support-libraries-must-use-the-exact -same-version-specification) –

回答

0

使用相同的版本,以支持庫的依賴關係。在你的情況下,將這些依賴版本更改爲「25.3.1」。

compile 'com.android.support:appcompat-v7:25.3.1' 
compile 'com.android.support:support-v7:25.3.1' 
compile 'com.android.support:design:25.3.1' 
compile 'com.android.support:recyclerview-v7:25.3.1' 
+0

錯誤已經從我所說的行中消失了,但現在錯誤在這一行: compile'c​​om.android.support.constraint:constraint-layout:1.0.2' –

+0

@ AhmedKamel它沒有錯誤,你仍然可以運行你的項目。 –

+0

@AhmedKamel你有沒有在'build.gradle'中聲明Google Maven回購? '儲存庫{maven} {url url'https://maven.google.com' } }' – Siu

相關問題