marathon icon indicating copy to clipboard operation
marathon copied to clipboard

com.android.tools.build:gradle:4.2.2 not working with marathon

Open labelz opened this issue 3 years ago • 2 comments

Describe the bug Getting error on emulator when running marathon with com.android.tools.build:gradle:4.2.2

2021-07-19 15:24:47.121 18856-18856/com.test.driver.beta E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.test.driver.beta, PID: 18856
    java.lang.RuntimeException: Unable to instantiate instrumentation ComponentInfo{com.test.driver.beta.test/androidx.test.runner.AndroidJUnitRunner}: java.lang.ClassNotFoundException: Didn't find class "androidx.test.runner.AndroidJUnitRunner" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/system/framework/android.test.mock.jar", zip file "/data/app/com.linecorp.lineman.driver.beta.test-3ZNM_Mqw8bsVQUMlzVQQ0w==/base.apk", zip file "/data/app/com.linecorp.lineman.driver.beta-_PybBRM411IF4zJ91wNrNg==/base.apk"],nativeLibraryDirectories=[/system/lib64]]

but it work well if downgrade to com.android.tools.build:gradle:4.0.1

To Reproduce Steps to reproduce the behaviour:

name: UI E2E Tests
outputDir: app/build/reports/marathon
debug: true
batchingStrategy:
  type: "fixed-size"
  size: 5
poolingStrategy:
- type: "os-version"
retryStrategy:
  type: "fixed-quota"
  totalAllowedRetryQuota: 100
  retryPerTestQuota: 2
filteringConfiguration:
  allowlist:
  - type: "annotation"
    regex: ".*LargeTest"
testClassRegexes:
- ^((?!Abstract).)*Test
includeSerialRegexes:
- emulator-5554
testOutputTimeoutMillis: 600000 # 10 minutes timeout
vendorConfiguration:
  type: "Android"
  androidSdk: "/Users/hey/Library/Android/sdk"
  applicationApk: "app_install/test-beta.apk"
  testApplicationApk: app/build/outputs/apk/androidTest/beta/debug/app-beta-debug-androidTest.apk
  autoGrantPermission: true
  serialStrategy: "ddms"
  1. Using com.android.tools.build:gradle:4.2.2
  2. Build the APK with that version
  3. running marathon with that APK

Expected behavior It should work on latest version.

Logs and reports

2021-07-19 15:24:47.121 18856-18856/com.test.driver.beta E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.test.driver.beta, PID: 18856
    java.lang.RuntimeException: Unable to instantiate instrumentation ComponentInfo{com.test.driver.beta.test/androidx.test.runner.AndroidJUnitRunner}: java.lang.ClassNotFoundException: Didn't find class "androidx.test.runner.AndroidJUnitRunner" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/system/framework/android.test.mock.jar", zip file "/data/app/com.linecorp.lineman.driver.beta.test-3ZNM_Mqw8bsVQUMlzVQQ0w==/base.apk", zip file "/data/app/com.linecorp.lineman.driver.beta-_PybBRM411IF4zJ91wNrNg==/base.apk"],nativeLibraryDirectories=[/system/lib64]]

Devices (please complete the following information):

  • Device: emulator

labelz avatar Jul 21 '21 02:07 labelz

Hey @labelz, thanks for submitting this!

I tried to reproduce your problem and couldn't achieve the same behaviour. I suspect something is wrong with your setup of building the test application. Is there any chance you're not using the "androidx.test:runner:X.X.X" dependency? Or maybe you're using apk splits? Another thing I see from the error log is that you have two apks there, maybe multidex is not working?

Feel free to try to reproduce this on the sample/android-app, but as I said, I tried to check and it seems to be working fine.

Malinskiy avatar Jul 30 '21 06:07 Malinskiy

Any update on this @labelz? Did you figure out a solution? The problem that you have here is related to the way you're assembling the test apk. Since you're specifying

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

marathon assumes that you have is in your code with something like:

androidTestImplementation('androidx.test:runner:1.4.0')

See the official docs page for more info

Malinskiy avatar Nov 14 '21 06:11 Malinskiy

Closing due to inactivity + AGP 4.2.2 is not supported anymore via Gradle plugin

Malinskiy avatar Sep 16 '22 08:09 Malinskiy