相关疑难解决方法(0)

错误:与依赖项'com.google.code.findbugs:jsr305'冲突

我在Android Studio 2.2 Preview 1中使用Android App和Backend模块在Google Messaging中创建了一个新项目.这是应用程序文件:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.3"
    defaultConfig {
        applicationId "com.xxx.xxx"
        minSdkVersion 15
        targetSdkVersion 23
        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'])
    compile 'com.android.support:appcompat-v7:23.4.0'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha1'
    compile 'com.google.android.gms:play-services-gcm:9.0.0'
    testCompile 'junit:junit:4.12'
    androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
    androidTestCompile 'com.android.support.test:runner:0.5'
    androidTestCompile 'com.android.support:support-annotations:23.4.0'
    compile project(path: ':backend', configuration: 'android-endpoints')
}
Run Code Online (Sandbox Code Playgroud)

但它给了:

错误:与依赖项'com.google.code.findbugs:jsr305'冲突.app(1.3.9)和测试app(2.0.1)的已解决版本有所不同.有关详细信息,请参阅http://g.co/androidstudio/app-test-app-conflict.

我是Android的新手,无法找到这个错误.我如何解决它?

gradle google-cloud-messaging android-studio build.gradle android-gradle-plugin

238
推荐指数
7
解决办法
10万
查看次数

com.google.android.gms:各种其他图书馆正在请求play-services-measurement-base

我更新到gradle 4.0.1并开始收到以下错误

图书馆com.google.android.gms:play-services-measurement-base正在[[15.0.4,15.0.4]]的各个其他图书馆请求,但已解析为15.0.2.禁用插件并使用./gradlew:app:dependencies检查依赖关系树.

我的项目没有使用那种依赖,所以我在全球范围内搜索它,它只出现在里面

建立/中间体/棉绒的高速缓存/ maven.google/COM /谷歌/机器人/克/基INDEX.XML

就像这一行

__CODE__

所以我尝试删除我的构建文件夹并清理项目,但它使用相同的值重新生成它:/因此错误仍然存​​在

android gradle google-play-services android-gradle-plugin

164
推荐指数
7
解决办法
15万
查看次数

Android依赖项对于编译和运行时具有不同的版本

将Android Studio从Canary 3更新为Canary 4后,在构建时抛出以下错误.

Android依赖项'com.android.support:support-support-v4'具有不同版本的编译(25.2.0)和运行时(26.0.0-beta2)类路径.您应该通过DependencyResolution手动设置相同的版本.

我在整个项目中进行了完整的搜索,并且版本25.1.0没有使用.

APP-的build.gradle

android {
compileSdkVersion 26
buildToolsVersion '26.0.0'


defaultConfig {
    applicationId "com.xxx.xxxx"
    minSdkVersion 14
    targetSdkVersion
    versionCode 1
    versionName "1.0"
    multiDexEnabled true

}


buildTypes {
    debug {
        debuggable true
    }
    release {
        debuggable false
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }

    lintOptions {
        abortOnError false
    }

}}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
testImplementation 'junit:junit:4.12'
implementation project(':core')
implementation com.google.android.gms:play-services-gcm:9.0.0'

implementation('com.crashlytics.sdk.android:crashlytics:2.6.5@aar') {
    transitive = true
}
implementation 'com.android.support:multidex:1.0.1'
implementation …
Run Code Online (Sandbox Code Playgroud)

android build.gradle android-gradle-plugin

99
推荐指数
7
解决办法
12万
查看次数