Cannot find a version of 'com.android.support:support-annotations' that satisfies

Error:Internal error:
org.gradle.tooling.BuildException: Could not execute build using Gradle distribution 'https://services.gradle.org/distributions/gradle-4.10.1-all.zip'.
	 .......
	org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getSelectedArtifacts(DefaultConfiguration.java:1037)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$ConfigurationFileCollection.getFiles(DefaultConfiguration.java:1025)
	... 43 more
Caused by: org.gradle.api.GradleException: Cannot find a version of 'com.android.support:support-annotations' that satisfies the version constraints: 
   Dependency path 'xxx:app:unspecified' --> 'com.android.support.test:runner:1.0.2' --> 'com.android.support:support-annotations:27.1.1'
   Dependency path 'xxx:app:unspecified' --> 'com.android.support:appcompat-v7:26.1.0' --> 'com.android.support:support-annotations:26.1.0'
   Dependency path 'xxx:app:unspecified' --> 'com.android.support.test:runner:1.0.2' --> 'com.android.support.test:monitor:1.0.2' --> 'com.android.support:support-annotations:27.1.1'
   Dependency path 'xxx:app:unspecified' --> 'com.android.support.test.espresso:espresso-core:3.0.2' --> 'com.android.support.test:runner:1.0.2' --> 'com.android.support:support-annotations:27.1.1'
   Dependency path 'xxx:app:unspecified' --> 'com.android.support:appcompat-v7:26.1.0' --> 'com.android.support:support-vector-drawable:26.1.0' --> 'com.android.support:support-annotations:26.1.0'
   Dependency path 'xxx:app:unspecified' --> 'com.android.support:appcompat-v7:26.1.0' --> 'com.android.support:support-v4:26.1.0' --> 'com.android.support:support-compat:26.1.0' --> 'com.android.support:support-annotations:26.1.0'
   Dependency path 'xxx:app:unspecified' --> 'com.android.support:appcompat-v7:26.1.0' --> 'com.android.support:support-v4:26.1.0' --> 'com.android.support:support-media-compat:26.1.0' --> 'com.android.support:support-annotations:26.1.0'
   Dependency path 'xxx:app:unspecified' --> 'com.android.support:appcompat-v7:26.1.0' --> 'com.android.support:support-v4:26.1.0' --> 'com.android.support:support-core-utils:26.1.0' --> 'com.android.support:support-annotations:26.1.0'
   Dependency path 'xxx:app:unspecified' --> 'com.android.support:appcompat-v7:26.1.0' --> 'com.android.support:support-v4:26.1.0' --> 'com.android.support:support-core-ui:26.1.0' --> 'com.android.support:support-annotations:26.1.0'
   Dependency path 'xxxx:app:unspecified' --> 'xxx:loginmanager:unspecified' --> 'com.yanzhenjie:permission:1.0.7' --> 'com.android.support:appcompat-v7:26.1.0' --> 'com.android.support:support-annotations:26.1.0'
   Constraint path 'xxx:app:unspecified' --> 'com.android.support:support-annotations' strictly '26.1.0' because of the following reason: debugRuntimeClasspath uses version 26.1.0
   Constraint path 'xxx:app:unspecified' --> 'com.android.support:support-annotations' strictly '26.1.0' because of the following reason: debugRuntimeClasspath uses version 26.1.0
   Constraint path 'xxx:app:unspecified' --> 'com.android.support:support-annotations' strictly '26.1.0' because of the following reason: debugRuntimeClasspath uses version 26.1.0
   Constraint path 'xxx:app:unspecified' --> 'com.android.support:support-annotations' strictly '26.1.0' because of the following reason: debugRuntimeClasspath uses version 26.1.0

	at org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder.validateGraph(DependencyGraphBuilder.java:322)
	... 59 more

将Gradle版本从3.0.0修改成3.3.2之后,重新编译,出错.

从错误信息中我们可以推测出是support-annotations这个包重复了,有27.1.1的依赖和26.1.0的依赖,所以修改其中一个,让其保持一致,

或者将使用27.1.1的依赖关系去掉,将下面的引用注释掉:

androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

编译OK

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值