- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试学习 android espresso .. 我遵循了一些基本教程,并且运行良好。但是现在我想对android抽屉导航做一些测试。为此,我需要使用 gradle 依赖项 androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2.2' 但它会导致与其他依赖项发生冲突。我的gradle文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "my.com.myapp_android"
minSdkVersion 18
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'
}
}
}
repositories {
jcenter()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
//material design
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:support-v4:23.3.0'
//zxing
compile 'com.journeyapps:zxing-android-embedded:3.2.0@aar'
compile 'com.google.zxing:core:3.2.1'
//Testing
// Optional -- Mockito framework
testCompile 'org.mockito:mockito-core:1.10.19'
androidTestCompile 'com.android.support:support-annotations:23.3.0'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.4.1'
// Optional -- Hamcrest library
androidTestCompile 'org.hamcrest:hamcrest-library:1.3'
// Optional -- UI testing with Espresso
androidTestCompile 'com.android.support.test.espresso:espresso-core:2.2.2'
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2.2'
// Optional -- UI testing with UI Automator
androidTestCompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1'
//inMarketSDK
//compile group: 'com.inmarket', name: 'm2msdk', version: '2.29', ext: 'aar'
}
Error:Conflict with dependency 'com.android.support:support-v4'. Resolved versions for app (23.3.0) and test app (23.1.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
Error:Conflict with dependency 'com.android.support:appcompat-v7'. Resolved versions for app (23.3.0) and test app (23.1.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
androidTestCompile ('com.android.support.test.espresso:espresso-core:2.2.2') {
// Necessary if your app targets Marshmallow (since Espresso
// hasn't moved to Marshmallow yet)
exclude group: 'com.android.support', module: 'support-annotations'
}
androidTestCompile ('com.android.support.test.espresso:espresso-contrib:2.2.2')
{
// Necessary if your app targets Marshmallow (since Espresso
// hasn't moved to Marshmallow yet)
exclude group: 'com.android.support', module: 'support-annotations'
}
最佳答案
TL; 博士;
新版 espresso-contrib 2.2.2
库现在依赖于 com.android.support:appcompat-v7:23.1.1
使用不同版本的 appcompat-v7
导致冲突在我们的 compile
时间依赖性如下:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2.2'
}
appcompat-v7
时发生冲突依赖来自
espresso-contrib
如下所示,由于对
design support
的某些值依赖,它再次中断库。
androidTestCompile ('com.android.support.test.espresso:espresso-contrib:2.2.2'){
exclude module: 'support-annotations'
exclude module: 'support-v4'
exclude module: 'support-v13'
exclude module: 'recyclerview-v7'
exclude module: 'appcompat-v7'
}
Error:(69) Error retrieving parent for item: No resource found that matches the given name 'TextAppearance.AppCompat.Display1'.
This is because the
design
support lib has dependency onappcompat-v7
.
So,when we exclude 'appcompat-v7' module fromespresso-contrib
dependencies(like above) , thedesign
support lib downloaded as part of transitive dependency ofespresso-contrib
lib couldn't find the compatible version ofappcompat-v7 lib(23.1.1)
it is using internally in its resources files and thus gives out the above error.
espresso-contrib
中排除 'design-support' lib 依赖项。像下面这样:
androidTestCompile ('com.android.support.test.espresso:espresso-contrib:2.2.2'){
exclude module: 'support-annotations'
exclude module: 'support-v4'
exclude module: 'support-v13'
exclude module: 'recyclerview-v7'
exclude module: 'design'
}
Step 1:Using Espresso-Contrib Lib version 2.2.1
app/build.gradle
中添加以下行文件:
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support.test.espresso:espresso-contrib:2.2.1'
appcompat-v7,recyclerview-v7,etc
.
espresso-contrib 2.2.1
lib 对 23.0.1 版本具有传递依赖关系
support-v4
,
recyclerview-v7
,
support-annotations
,等等。
recyclerview-v7
定义依赖项,
support-annotations
在我的项目中,上述设置可以正常工作。
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:support-v4:23.3.0'
androidTestCompile ('com.android.support.test.espresso:espresso-contrib:2.2.1'){
exclude module: 'support-annotations'
exclude module: 'support-v4'
exclude module: 'support-v13'
exclude module: 'recyclerview-v7'
}
espresso-contrib
的一部分下载。传递依赖。
Step 2: Using Espresso-Contrib lib version 2.2.2
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:support-v4:23.3.0'
testCompile 'junit:junit:4.12'
androidTestCompile ('com.android.support.test.espresso:espresso-contrib:2.2.2'){
exclude module: 'support-annotations'
exclude module: 'support-v4'
exclude module: 'support-v13'
exclude module: 'recyclerview-v7'
}
}
Error:Conflict with dependency 'com.android.support:appcompat-v7'. Resolved versions for app (23.3.0) and test app (23.1.1) differ. See http://g.co/androidstudio/app-test-app-conflict for details.
exclude module: 'appcompat-v7' (inside androidTestCompile block of espresso-contrib)
espresso-contrib 2.2.2
lib 现在具有对
com.android.support:design:23.1.1
的传递依赖造成上述冲突。
androidTestCompile ('com.android.support.test.espresso:espresso-contrib:2.2.2')
中添加以下行堵塞:
exclude module: 'design'
关于android-gradle-plugin - Android espresso-contrib gradle 构建失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37307671/
我只想在我保存的单个文件上运行coffee lint和coffee compile。我的项目中有成百上千个CoffeeScript文件,而编译它们都需要太多时间。 这是我的Gruntfile: mod
我正在使用 grunt-contrib-compass 来处理我的 .SCSS 文件 compass: { dist: { options: { cssDir: 'www/st
不幸的是,grunt-contrib-watch和 grunt-contrib-connect看起来不太好。 关于 grunt-contrib-connect readme它说: Note that
我是 nodeJS 和 grunt 的新手。我在这个项目中有这个 Gruntfile,我想对我项目中的所有 html 文件进行实时重新加载,这样我就不必一直刷新浏览器来检测新的更改。不知何故,我遇到了
我已经根据这些下载并构建了open cv open cv docs . 我正在尝试编译这个 Eigenfaces demo ,我收到以下错误。 fatal error: 'opencv2/contri
我有两个目录 src 和 compiled。我想使用 Grunt Watch 确保从 src 到 compiled 的单向数据同步.作为中间步骤,我想编译 *.less 文件以及使用 ES6 语法编写
我创建了一个 lein 项目, 比使用 eclips 的 dev-dependency 更新它的 project.clj 我跑了“lein deps” 它下载了所有依赖项 但是在 my.m2/repo
我有一些在 RStudio 中完美执行的 R 代码,但是当我在 cmd 中运行它时,我收到以下错误。 Installing package into 'C:/Users/Anish/Documents
我正在尝试为上下文强盗问题 (https://medium.com/emergent-future/simple-reinforcement-learning-with-tensorflow-part
序曲: Ant-Contrib 为安装和启动提供了一个很好解释的 wiki 页面 ([ http://ant-contrib.sourceforge.net/#install][1] )。 事实上,只
当我尝试使用 Ant-contrib 的 FOR 循环时遇到以下错误: Invalid type class org.apache.tools.ant.taskdefs.optional.script
我正在使用DapperExtensions v4.0.30319,并且试图让Dapper.Contrib知道我的架构不是DBO。我提供了: public class EngineMapper : Cl
他们无论如何要直接生成缩小的 js 吗?我不想使用其他命令,例如 grunt uglify 因为源映射不会指向咖啡而是指向 js 最佳答案 我明白你对源 map 的看法,但你仍然可以在一个链中使用 u
我是整个 JVM 方面的新手,正在尝试使用 clojure。我正在尝试加载 clojure-contrib 但失败了: # in bash $ java -cp /path/to/clojure.ja
我正在使用 ant,并且在 if/then/else 任务(ant-contrib-1.0b3.jar)上遇到问题。 我正在运行一些可以使用下面的 build.xml 进行简化的东西。 我期待从 'a
我正在使用grunt-contrib-jasmine运行我的JavaScript规范。运行规范时如何将调试输出写入控制台,即如何获取 console.log("something"); 在控制台中显示
占用的问题 我运行以下命令来安装旧版本的opencv-contrib-python(4.0.0.21)。然后发生错误,无法安装此软件包。如何解决此错误? pip install opencv-cont
互联网上是否有可用的 Wicket Contrib Examples 的源代码- CD应用程序?谢谢。 最佳答案 您说您在对 Don 的回答的评论中查看了“svn”;哪个SVN?是这个吗? http:
我在 Maven 中使用 FindBugs,使用以下配置: org.codehaus.mojo findbugs-mave
我的构建脚本中有以下任务。 我从我的 Mac 机器运行这个构建脚本。它给出了以下错误。 Problem: failed to cr
我是一名优秀的程序员,十分优秀!