简体   繁体   English

resolutionstrategy.force非常慢

[英]resolutionstrategy.force is very slow

I am developing an Android application in which I resolved a dependency problem with gradle using the following addition to my build.gradle : 我正在开发一个Android应用程序,其中使用以下build.gradle附加项解决了gradle的依赖项问题:

configurations.all {
    resolutionStrategy.force 'junit:junit:4.12'
}

This leads to an enormous build-time increase (from ~15s to ~60s). 这导致了巨大的构建时间增加(从〜15s到〜60s)。 Is there any way to decrease the build time, for example by resolving the conflict in JUnit versions another way? 是否有任何方法可以减少构建时间,例如通过另一种方法解决JUnit版本中的冲突? The conflict was introduced by compile 'com.googlecode.json-simple:json-simple:1.1.1' , which uses an earlier JUnit version. 通过使用早期JUnit版本的compile 'com.googlecode.json-simple:json-simple:1.1.1'引入了冲突。

You may add the junit dependency explicitely as a direct dependency, and set forced = true on it. 您可以明确地将junit依赖项添加为直接依赖项,并在其上设置forced = true

Examples here: http://www.devsbedevin.net/android-understanding-gradle-dependencies-and-resolving-conflicts/ 此处的示例: http : //www.devsbedevin.net/android-understanding-gradle-dependencies-and-resolving-conflicts/

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM