Skip to content

Android-library breaks Instrumented Tests #1008

@be-glass

Description

@be-glass

As soon as nextcloud/android-library is part of the project, the instrumented test runner fails with

E/AndroidRuntime: FATAL EXCEPTION: Instr: androidx.test.runner.AndroidJUnitRunner
    Process: com.glass.myapplication, PID: 10012
    java.lang.NoSuchMethodError: No virtual method intersect(Lorg/junit/runner/manipulation/Filter;)Lorg/junit/runner/manipulation/Filter; in class Landroidx/test/internal/runner/TestRequestBuilder$AnnotationExclusionFilter; or its super classes (declaration of 'androidx.test.internal.runner.TestRequestBuilder$AnnotationExclusionFilter' appears in /data/app/~~-ll-TtJdRUtQZzvWvkndfA==/com.glass.myapplication.test-sfWYAhUDGvpil6R8QOqRmA==/base.apk)

Steps to reproduce:

  1. open Android-Studio (Dolphin | 2021.3.1. Patch 1)
  2. create new project: "Empty Compose Activity"
  3. build project as is
  4. run ExampleInstrumentedTest / useAppContext -> success
  5. add "implementation 'com.github.nextcloud:android-library:-SNAPSHOT'" to build.gradle/dependencies
  6. check build.gradle/compileOptions (no change needed)
  7. add commons-httpclient to build.gradle/dependencies
  8. add 'maven { url "https://jitpack.io" }' to settings.gradle/ dependencyResolutionManagement/ repositories
  9. add configurations.all{exclude ...} to build.gradle
  10. 'Sync Now' in Android Studio
  11. re-run ExampleInstrumentedTest / useAppContext -> Fails with error log above

(minSDK was 30, as well as 21)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions