小编Mab*_*bad的帖子

警告:与依赖项"com.android.support:support-annotations"冲突

我几乎尝试了书中的每一个技巧.

  • ResolutionStrategy.force
  • 不包括模块

但似乎没有任何效果,下面是我的build.gradle.我正在使用Gradle版本1.2.3.有人可以说清楚我的代码还有什么问题.

我唯一没试过的是改变Gradle的版本.这是一个非常基本的Espresso测试案例.谢谢!

apply plugin: 'com.android.application'
android {
    configurations.all {
        resolutionStrategy.force 'com.android.support:support-annotations:22.1.0'
    }
    compileSdkVersion 22
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.example.rasika.job"
        minSdkVersion 16
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidUnitRunner"

    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
repositories {
    mavenCentral()
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.1.1'

    testCompile 'junit:junit:4.12'

    androidTestCompile 'com.android.support.test:runner:0.3'
    androidTestCompile 'com.android.support.test:rules:0.3'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2'
    androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
    androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.0'
}
Run Code Online (Sandbox Code Playgroud)

testing dependencies android android-support-library

37
推荐指数
4
解决办法
3万
查看次数