简体   繁体   English

Gradle:应用和测试应用的已解决版本不同

[英]Gradle: Resolved versions for app and test app differ

When I add the dependency: 当我添加依赖项时:

compile 'net.bytebuddy:byte-buddy-android:0.7.8'

in my app, I get this error: 在我的应用程序中,我收到此错误:

Conflict with dependency 'net.bytebuddy:byte-buddy'. Resolved versions for app (0.7.8) and test app (0.6.14) differ. See http://g.co/androidstudio/app-test-app-conflict for details.

I have visited http://g.co/androidstudio/app-test-app-conflict and it says: 我访问了http://g.co/androidstudio/app-test-app-conflict ,它说:

Gradle build will fail if the main APK and the test APK use the same library (eg Guava) but in different versions.[...] To make the build succeed, just make sure both APKs use the same version 如果主APK和测试APK使用相同的库(例如Guava)但是在不同的版本中,Gradle构建将失败。[...]为了使构建成功,只需确保两个APK使用相同的版本

But I don't know what it means. 但我不知道这意味着什么。

Can you help me? 你能帮助我吗? Thanks. 谢谢。

build.gradle 的build.gradle

    ...
     buildTypes {

            all {
                //just build some config fields
            }

            demo.initWith(buildTypes.debug)
            demo {
                //just build some config fields
            }

            devel.initWith(buildTypes.debug)
            devel {
                //just build some config fields
            }

            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                signingConfig signingConfigs.gg
                //just build some config fields
            }
        }

lintOptions {
    checkReleaseBuilds false
    abortOnError false
}

    ...

您可以使用以下方法强制测试中的版本:

androidTestCompile 'net.bytebuddy:byte-buddy-android:0.7.8'

You can force the version without adding an extraneous dependency by adding this to your gradle file 您可以通过将此项添加到gradle文件来强制该版本而不添加无关的依赖项

configurations.all {
    resolutionStrategy {
        force 'net.bytebuddy:byte-buddy-android:0.7.8'
    }
}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 应用程式和测试应用程式的Android Espresso 2.2.1解析版本不同 - Android Espresso 2.2.1 Resolved versions for app and test app differ 应用(1.1)和测试应用(1.3)的已解决版本不同 - Resolved versions for app (1.1) and test app (1.3) differ app(22.0.0)和测试app(21.0.3)的已解决版本有所不同 - Resolved versions for app (22.0.0) and test app (21.0.3) differ app(26.1.0)和测试app(27.1.1)的已解决版本有所不同 - Resolved versions for app (26.1.0) and test app (27.1.1) differ 在项目':app'中与依赖'com.google.code.gson:gson'冲突。 app(2.7)和测试app(2.8.0)的已解决版本不同 - Conflict with dependency 'com.google.code.gson:gson' in project ':app'. Resolved versions for app (2.7) and test app (2.8.0) differ 与项目':app'中的依赖项冲突。 app(15.0.2)和测试app(12.0.1)的已解决版本不同(可能是信号和firebase问题) - Conflict with dependency in project ':app'. Resolved versions for app (15.0.2) and test app (12.0.1) differ (possibly onesignal&firebase issue) 错误:与项目':app'中的依赖项'com.android.support:support-v4'发生冲突。 应用(25.3.1)和测试应用(23.1.1)的已解决版本不同 - Error:Conflict with dependency 'com.android.support:support-v4' in project ':app'. Resolved versions for app (25.3.1) and test app (23.1.1) differ 与项目':app'中的依赖'com.android.support:support-annotations'冲突。 app(26.1.0)和测试app(27.1.1)的已解决版本有所不同。 - Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (26.1.0) and test app (27.1.1) differ. 错误:在项目':app'中与依赖项'com.google.guava:guava'发生冲突。 应用(18.0)和测试应用(16.0.1)的已解决版本不同 - Error:Conflict with dependency 'com.google.guava:guava' in project ':app'. Resolved versions for app (18.0) and test app (16.0.1) differ Espresso错误:与依赖项“ com.android.support:support-v4”发生冲突。 应用(24.2.0)和测试应用(23.1.1)的已解决版本不同 - Espresso Error:Conflict with dependency 'com.android.support:support-v4'. Resolved versions for app (24.2.0) and test app (23.1.1) differ
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM