问题描述
- android依赖和测试依赖冲突
-
我是andorid新手,使用android studio 2.0.0写了一个hello world程序。
现在想写一个android测试,加入了测试框架依赖以后,出现了版本冲突,错误如下
Error:Conflict with dependency 'com.android.support:support-annotations'. Resolved versions for app (23.3.0) and test app (22.2.0) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
哪位大神帮忙看看怎么处理,先谢了。apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { applicationId "com.example.myapp" minSdkVersion 15 targetSdkVersion 23 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.3.0' // Android Test androidTestCompile 'com.android.support.test:runner:0.3' androidTestCompile 'com.android.support.test:rules:0.3' androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2' androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1' }
解决方案
http://my.oschina.net/stphwn/blog/343711
解决方案二:
这是gradle导入的依赖jar,该如何修改dependencies
解决方案三:
直接依赖,间接依赖,可选依赖,排除依赖,依赖冲突
时间: 2024-09-15 15:33:35