Android:如何使用支持25.0.0的Espresso 2.2.2?

tm1*_*701 2 android dependency-management gradle android-espresso android-design-library

我怎样才能使这个工作?我读了很多类似的策略,唉.使用高于23.1.1的支持库会一次又一次失败.

dependencies {
  compile 'com.android.support:design:25.0.0'
  compile 'com.android.support:support-v4:25.0.0'
  compile files('libs/slf4j-android-1.5.8.jar')
  androidTestCompile 'com.android.support:support-annotations:25.0.0'
  androidTestCompile( 'com.android.support.test:rules:0.5')
  androidTestCompile( 'com.android.support.test.espresso:espresso-contrib:2.2.2')
  androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
 })
}
Run Code Online (Sandbox Code Playgroud)

我收到了这条消息:

警告:与依赖项'com.android.support:recyclerview-v7'冲突.app(25.0.0)和测试app(23.1.1)的已解决版本有所不同.有关详细信息,请参阅http://g.co/androidstudio/app-test-app-conflict.警告:与依赖项'com.android.support:support-v4'冲突.app(25.0.0)和测试app(23.1.1)的已解决版本有所不同.有关详细信息,请参阅http://g.co/androidstudio/app-test-app-conflict.警告:与依赖项'com.android.support:appcompat-v7'冲突.app(25.0.0)和测试app(23.1.1)的已解决版本有所不同.有关详细信息,请参阅http://g.co/androidstudio/app-test-app-conflict.警告:与依赖项"com.android.support:design"冲突.app(25.0.0)和测试app(23.1.1)的已解决版本有所不同.有关详细信息,请参阅http://g.co/androidstudio/app-test-app-conflict.

第1步:我尝试使用排除组...没有用.

第2步:我也尝试了不同的策略,例如:configurations.all {resolutionStrategy {force'com.android.support:support-annotations:23.1.1'}}

第3步:当然我尝试了第一个gradlew:app:dependenices等,但是那个一直在崩溃.是的,我使用的是JDK1.8.这是一个注册的bug,自夏天以来一直没有解决.

顺便说一句...... Android,支持包和Espresso都来自谷歌?

mac*_*usz 11

尝试

dependencies {
  compile 'com.android.support:design:25.0.0'
  compile 'com.android.support:support-v4:25.0.0'
  compile files('libs/slf4j-android-1.5.8.jar')
  androidTestCompile 'com.android.support:support-annotations:25.0.0'
  androidTestCompile('com.android.support.test:rules:0.5') {
               exclude module: 'support-annotations'
  }
  androidTestCompile('com.android.support.test.espresso:espresso-contrib:2.2.2') {
               exclude module: 'espresso-core'
               exclude module: 'support-v4'
               exclude module: 'recyclerview-v7'
               exclude module: 'appcompat-v7'
               exclude module: 'support-annotations'
               exclude module: 'design'
  }
  androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2') {
               exclude module: 'rules'
               exclude module: 'javax.annotation-api'
               exclude module: 'support-annotations'
  }
Run Code Online (Sandbox Code Playgroud)

这是我的工作设置 - 您基本上从所有Espresso依赖项中排除支持注释,并让它们使用从标准运行时依赖项中解析的注释.其他一些依赖项给我带来了麻烦所以我只是将它们排除在外,让构建从显式compile语句中解析它们.