如何使Apollo GraphQL在带有Espresso测试的Android项目中工作?

时间:2019-03-03 16:30:54

标签: android gradle android-espresso apollo

我认为这是有关gradle依赖关系的问题,但我不确定。以下两个软件包之间似乎不兼容:

    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    androidTestImplementation 'com.apollographql.apollo:apollo-runtime:1.0.0-alpha5'

我收到以下错误,看来无法解决:

Cannot find a version of 'com.google.code.findbugs:jsr305' that satisfies the version constraints: 
   Dependency path 'TestApp:app:unspecified' --> 'androidx.test.espresso:espresso-core:3.1.1' --> 'com.google.code.findbugs:jsr305:2.0.1'
   Dependency path 'TestApp:app:unspecified' --> 'androidx.test.espresso:espresso-intents:3.1.1' --> 'androidx.test.espresso:espresso-core:3.1.1' --> 'com.google.code.findbugs:jsr305:2.0.1'
   Dependency path 'TestApp:app:unspecified' --> 'androidx.test.ext:truth:1.0.0' --> 'com.google.guava:guava:26.0-android' --> 'com.google.code.findbugs:jsr305:3.0.2'
   Dependency path 'TestApp:app:unspecified' --> 'com.apollographql.apollo:apollo-runtime:1.0.0-alpha5' --> 'com.nytimes.android:cache:2.0.2' --> 'com.google.code.findbugs:jsr305:3.0.1'
   Constraint path 'TestApp:app:unspecified' --> 'com.google.code.findbugs:jsr305' strictly '3.0.1' because of the following reason: debugRuntimeClasspath uses version 3.0.1
   Constraint path 'TestApp:app:unspecified' --> 'com.google.code.findbugs:jsr305' strictly '3.0.1' because of the following reason: debugRuntimeClasspath uses version 3.0.1
   Constraint path 'TestApp:app:unspecified' --> 'com.google.code.findbugs:jsr305' strictly '3.0.1' because of the following reason: debugRuntimeClasspath uses version 3.0.1

我完整的依赖项是:

    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
    implementation 'com.apollographql.apollo:apollo-runtime:1.0.0-alpha5'
    implementation 'com.apollographql.apollo:apollo-espresso-support:1.0.0-alpha5'

    testImplementation 'io.kotlintest:kotlintest-runner-junit5:3.2.1'
    testImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0'
    testImplementation 'com.apollographql.apollo:apollo-runtime:1.0.0-alpha5'
    testImplementation 'com.apollographql.apollo:apollo-espresso-support:1.0.0-alpha5'

    androidTestImplementation 'androidx.test:runner:1.1.1'
    androidTestImplementation 'androidx.test.ext:junit:1.1.0'
    androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
    androidTestImplementation 'androidx.test.ext:truth:1.0.0'
    androidTestImplementation 'com.nhaarman.mockitokotlin2:mockito-kotlin:2.1.0'
    androidTestImplementation 'com.apollographql.apollo:apollo-runtime:1.0.0-alpha5'
    androidTestImplementation 'com.apollographql.apollo:apollo-espresso-support:1.0.0-alpha5'

是否可以在同一个Android项目中使用Apollo和Espresso并采取某种变通方法或解决此问题,或者这是个秀发大步,意味着他们根本无法一起工作?

0 个答案:

没有答案