Android Studio3.0新建项目报错

        提示的错误是Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.

        大概意思是:support-annotations这个依赖冲突,APP的解决版本是26.1.0, 测试APP版本为27.1.1。可是我明明没有导入support-annotations依赖啊。

出错版本依赖列表

        查看External Libraries,确实存在两个support-annotations版本依赖。

这到底是怎么回事呢?

原来,'com.android.support.test.espresso:espresso-core:3.0.2' 有'com.android.support:support-annotations:27.1.1'的引用。

解决办法:加入

configurations.all {

    resolutionStrategy.force'com.android.support:support-annotations:26.1.0'

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容