2017-08-29 88 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' 
     } 
    } 
}