将@jar或@aar添加到Gradle依赖关系中断自动依赖关系解析

时间:2017-03-03 00:49:36

标签: java android gradle pom.xml

将此添加到我的build.gradle:

compile 'com.android.support:support-v4:25.2.0'

导致gradle自动解析此lib的依赖项。 (我假设这是基于pom文件):

$ gradle -q dependencies

_debugCompile - ## Internal use, do not manually configure ##
\--- com.android.support:support-v4:25.2.0
     +--- com.android.support:support-compat:25.2.0
     |    \--- com.android.support:support-annotations:25.2.0
     +--- com.android.support:support-media-compat:25.2.0
     |    +--- com.android.support:support-annotations:25.2.0
     |    \--- com.android.support:support-compat:25.2.0 (*)
     +--- com.android.support:support-core-utils:25.2.0
     |    +--- com.android.support:support-annotations:25.2.0
     |    \--- com.android.support:support-compat:25.2.0 (*)
     +--- com.android.support:support-core-ui:25.2.0
     |    +--- com.android.support:support-annotations:25.2.0
     |    \--- com.android.support:support-compat:25.2.0 (*)
     \--- com.android.support:support-fragment:25.2.0
          +--- com.android.support:support-compat:25.2.0 (*)
          +--- com.android.support:support-media-compat:25.2.0 (*)
          +--- com.android.support:support-core-ui:25.2.0 (*)
          \--- com.android.support:support-core-utils:25.2.0 (*)

当我在build.gradle中明确要求jar或aar版本的包时

compile 'com.android.support:support-v4:25.2.0@aar' // or @jar

它打破了依赖性解析:

$ gradle -q dependencies

_debugCompile - ## Internal use, do not manually configure ##
\--- com.android.support:support-v4:25.2.0

问题:这是gradle中的错误,或者在使用@aar和@jar表示法时如何使gradle解决依赖关系?

0 个答案:

没有答案