2017-08-29 90 views
0

我有以下的的build.gradleAndroid的依賴錯誤

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 26 
    buildToolsVersion "26.0.1" 
    defaultConfig { 
     applicationId "com.example.myapp.myapplication" 
     minSdkVersion 14 
     targetSdkVersion 26 
     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:26.0.0' 
    compile 'com.android.support.constraint:constraint-layout:1.0.2' 
    compile 'com.thefinestartist:finestwebview:1.2.7' 
    testCompile 'junit:junit:4.12' 
} 
allprojects { 
    repositories { 
     jcenter() 
     maven { 
      url 'https://maven.google.com' 
     } 
    } 
} 

代碼,但我得到的錯誤以下行

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

enter image description here

enter image description here

任何一個可以幫助我如何解決這個問題?

+2

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

+1

您正在使用依賴三年支持庫的庫('com.thefinestartist:finestwebview:1.2.7')。我建議您停止使用該庫或將其分叉,以便您可以維護叉並保持其與支持庫版本的最新狀態。 – CommonsWare

+0

yup.thanks CommonsWare.Be因爲它給了一個erorr – iCoders

回答

0

這意味着你的構建版本是26.0.1,但是你的支持gradle版本是26.0.0。將支持appcompat版本從26.0.0更改爲26.0.1並構建。

+0

@AAalap Patel.that我已經嘗試仍然得到eror.even我已經添加alpha1 – iCoders

+0

構建工具版本必須是最新的,但其他庫版本 - 不是 – DeKaNszn

0

嘗試增加下面的代碼到您的項目級別build.gradle文件,它應該工作

allprojects { 
    repositories { 
     jcenter() 
     maven { 
      url 'https://maven.google.com' 
     } 
    } 
}