Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test execution hangs with invalid classpath (1.5.0 vs fragment-testing) #1589

Closed
TWiStErRob opened this issue Nov 12, 2022 · 6 comments
Closed

Comments

@TWiStErRob
Copy link
Contributor

Description

I just experienced this too, with the standard setup updating all libs at once. Excluding core helped. The reason I'm opening an issue is because my behavior is not the same as #1585, and I think the developer experience could be better. The key here is that the execution hangs, Gradle never fails. What would be expected is a real failure because there's something fundamentally wrong with the tests.

Steps to Reproduce

  1. Clone https://github.com/TWiStErRob/net.twisterrob.colorfilters
  2. Check out TWiStErRob/net.twisterrob.colorfilters@41c901f
  3. Bump espresso
    Index: gradle/libs.versions.toml
    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    ===================================================================
    diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
    --- a/gradle/libs.versions.toml	(revision 41c901f956c9e16d1e66edce2abc89220f911f33)
    +++ b/gradle/libs.versions.toml	(date 1668250873364)
    @@ -11,8 +11,8 @@
     androidx-preference = "1.2.0"
     androidx-multidex = "2.0.1"
     androidx-multidex-instrumentation = "2.0.0"
    -androidx-test = "1.4.0"
    -androidx-test-espresso = "3.4.0"
    +androidx-test = "1.5.0"
    +androidx-test-espresso = "3.5.0"
     
     junit4 = "4.13.2"
     jmh = "1.35"
  4. Run gradlew :feature:base:connectedDebugAndroidTest with an emulator or device.

Expected Results

Failure. At least something like:
image

Actual Results

Exception in logcat:

 Process: net.twisterrob.colorfilters.android.base.test, PID: 4493
 java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/test/platform/io/PlatformTestStorageRegistry;
    at androidx.test.internal.runner.RunnerArgs$Builder.<init>(RunnerArgs.java:248)
    at androidx.test.runner.AndroidJUnitRunner.parseRunnerArgs(AndroidJUnitRunner.java:393)
    at androidx.test.runner.AndroidJUnitRunner.onCreate(AndroidJUnitRunner.java:302)
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6717)
    at android.app.ActivityThread.access$1500(ActivityThread.java:247)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7839)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
 Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.test.platform.io.PlatformTestStorageRegistry" on path: DexPathList[[zip file "/data/app/~~dHZ_rrHCTsWwptmLIpog2Q==/net.twisterrob.colorfilters.android.base.test-zBwN9qljDyXNAmGHC_1_LQ==/base.apk"],nativeLibraryDirectories=[/data/app/~~dHZ_rrHCTsWwptmLIpog2Q==/net.twisterrob.colorfilters.android.base.test-zBwN9qljDyXNAmGHC_1_LQ==/lib/x86_64, /system/lib64, /system_ext/lib64]]
    at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:218)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
    at androidx.test.internal.runner.RunnerArgs$Builder.<init>(RunnerArgs.java:248) 
    at androidx.test.runner.AndroidJUnitRunner.parseRunnerArgs(AndroidJUnitRunner.java:393) 
    at androidx.test.runner.AndroidJUnitRunner.onCreate(AndroidJUnitRunner.java:302) 
    at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6717) 
    at android.app.ActivityThread.access$1500(ActivityThread.java:247) 
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053) 
    at android.os.Handler.dispatchMessage(Handler.java:106) 
    at android.os.Looper.loopOnce(Looper.java:201) 
    at android.os.Looper.loop(Looper.java:288) 
    at android.app.ActivityThread.main(ActivityThread.java:7839) 
    at java.lang.reflect.Method.invoke(Native Method) 
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) 
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) 

and :feature:base:connectedDebugAndroidTest doesn't ever complete.

Full logcat
--------- beginning of mainwisterrob.colorfilters>adb logcat        
11-12 12:29:19.884   855   867 W ssioncontrolle: Reducing the number of considered missed Gc histogram windows from 197 to 100
11-12 12:29:20.398   840   849 W ndroid.systemu: Reducing the number of considered missed Gc histogram windows from 231 to 100
11-12 12:29:23.847   463   463 W adbd    : timeout expired while flushing socket, closing
11-12 12:29:23.847   463   463 W adbd    : timeout expired while flushing socket, closing
--------- beginning of kernel
11-12 12:22:42.495     0     0 I init    : Untracked pid 4696 received signal 1
11-12 12:22:42.496     0     0 I init    : Untracked pid 4617 received signal 1
11-12 12:22:51.813     0     0 I logd    : logdr: UID=2000 GID=2000 PID=4743 b tail=0 logMask=99 pid=0 start=0ns deadline=0ns
11-12 12:29:41.812   840  1001 D EGL_emulation: app_time_stats: avg=41801.20ms min=41801.20ms max=41801.20ms count=1
--------- beginning of system
11-12 12:29:43.255   569   703 W RuleEvaluation: Integrity rule files are not available.
11-12 12:29:43.255   569   653 I PackageManager: Integrity check passed for file:///data/app/vmdl1631992704.tmp
11-12 12:29:43.259   569   630 I ActivityManager: Force stopping net.twisterrob.colorfilters.android.base.test appid=10106 user=-1: installPackageLI
11-12 12:29:43.259   569   653 I PackageManager: Update package net.twisterrob.colorfilters.android.base.test code path from /data/app/~~pF5z1aXVcNZbAxIJAww6Qw==/net.twisterrob.colorfilters.android.base.test-YgblluD
Yw5andvZ0aduEjA== to /data/app/~~3KMXhtHVNrLFH65gyRQXlg==/net.twisterrob.colorfilters.android.base.test-gvJmr7KtnL3D9DVECQ07Qw==; Retain data and using new
11-12 12:29:43.260   569   653 I PackageManager: Permission ownership changed. Updating all permissions.
11-12 12:29:43.263   569   630 I ActivityManager: Killing 4718:net.twisterrob.colorfilters.android.base.test/u0a106 (adj 0): stop net.twisterrob.colorfilters.android.base.test due to installPackageLI
11-12 12:29:43.264   569   630 W ActivityManager: Crash of app net.twisterrob.colorfilters.android.base.test running instrumentation ComponentInfo{net.twisterrob.colorfilters.android.base.test/androidx.test.runner.A
ndroidJUnitRunner}
11-12 12:29:43.266   569  4770 I ActivityManager: Failure reporting to instrumentation watcher: comp=ComponentInfo{net.twisterrob.colorfilters.android.base.test/androidx.test.runner.AndroidJUnitRunner} results=Bundl
e[{shortMsg=Process crashed.}]
11-12 12:23:00.910     0     0 I binder  : 569:4770 transaction failed 29189/-22, size 360-0 line 2737
11-12 12:29:43.272   366   366 I Zygote  : Process 4718 exited due to signal 9 (Killed)
11-12 12:29:43.289   569   632 I libprocessgroup: Successfully killed process cgroup uid 10106 pid 4718 in 25ms
11-12 12:29:43.295   569   653 D PackageManager: Instant App installer not found with android.intent.action.INSTALL_INSTANT_APP_PACKAGE
11-12 12:29:43.295   569   653 D PackageManager: Clear ephemeral installer activity
11-12 12:29:43.297   569   630 I ActivityManager: Force stopping net.twisterrob.colorfilters.android.base.test appid=10106 user=0: finished inst
11-12 12:29:43.299   569  1210 V ActivityManager: Got obituary of 4718:net.twisterrob.colorfilters.android.base.test
11-12 12:29:43.300   569   630 W ActivityManager: Error shutting down UiAutomationConnection
11-12 12:23:00.944     0     0 I binder  : 569:630 transaction failed 29189/-22, size 88-0 line 2737
11-12 12:29:43.307   476   707 E installd: Couldn't opendir /data/app/vmdl1631992704.tmp: No such file or directory
11-12 12:29:43.307   476   707 E installd: Failed to delete /data/app/vmdl1631992704.tmp: No such file or directory
11-12 12:29:43.308   569   653 I ActivityManager: Force stopping net.twisterrob.colorfilters.android.base.test appid=10106 user=0: pkg removed
11-12 12:29:43.313  1438  1438 I MediaProvider: Invalidating LocalCallingIdentity cache for package net.twisterrob.colorfilters.android.base.test. Reason: package android.intent.action.PACKAGE_REMOVED
11-12 12:29:43.318   569   695 I InputReader: Reconfiguring input devices, changes=KEYBOARD_LAYOUTS |
11-12 12:29:43.318   820   820 V MediaPlayerList: mPackageChangedBroadcastReceiver: action: android.intent.action.PACKAGE_REMOVED
11-12 12:29:43.319   569   630 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:net.twisterrob.colorfilters.android.base.test flg=0x4000010
 (has extras) } to com.android.gallery3d/.app.PackagesMonitor
11-12 12:29:43.333   365   365 I netd    : trafficSetNetPermForUids(0, [10106]) <0.01ms>
11-12 12:29:43.335   569   653 D CompatibilityChangeReporter: Compat change id reported: 168419799; UID 10106; state: DISABLED
11-12 12:29:43.338   569   569 I Telecom : CarModeTracker: Package net.twisterrob.colorfilters.android.base.test is not tracked.: SSH.oR@AMU
11-12 12:29:43.340   569   569 I Telecom : InCallController: updateCarModeForConnections: car mode apps: : SSH.oR@AMU
11-12 12:29:43.344  1438  1438 I MediaProvider: Invalidating LocalCallingIdentity cache for package net.twisterrob.colorfilters.android.base.test. Reason: package android.intent.action.PACKAGE_ADDED
11-12 12:29:43.361   569   618 D CompanionDeviceManagerService: onPackageModified(packageName = net.twisterrob.colorfilters.android.base.test)
11-12 12:29:43.361   569   695 I InputReader: Reconfiguring input devices, changes=KEYBOARD_LAYOUTS |
11-12 12:29:43.361   365   365 I netd    : trafficSetNetPermForUids(0, [10106]) <0.02ms>
11-12 12:29:43.362   569   569 I Telecom : DefaultDialerCache: Refreshing default dialer for user 0: now com.android.dialer: DDC.oR@AMY
11-12 12:29:43.362   820   820 V MediaPlayerList: mPackageChangedBroadcastReceiver: action: android.intent.action.PACKAGE_ADDED
11-12 12:29:43.362   820   820 D MediaPlayerList: Name of package changed: net.twisterrob.colorfilters.android.base.test
11-12 12:29:43.368   569   569 V BackupManagerConstants: getFullBackupIntervalMilliseconds(...) returns 86400000
11-12 12:29:43.369   569   569 V BackupManagerConstants: getFullBackupRequiredNetworkType(...) returns 2
11-12 12:29:43.369   569   569 V BackupManagerConstants: getFullBackupRequireCharging(...) returns true
11-12 12:29:43.376   569   695 I InputReader: Reconfiguring input devices, changes=KEYBOARD_LAYOUTS | 
11-12 12:29:43.376   569   630 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:net.twisterrob.colorfilters.android.base.test flg=0x4000010 (
has extras) } to com.android.packageinstaller/.PackageInstalledReceiver
11-12 12:29:43.383   569   630 W BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.PACKAGE_ADDED dat=package:net.twisterrob.colorfilters.android.base.test flg=0x4000010 (
has extras) } to com.android.gallery3d/.app.PackagesMonitor
11-12 12:29:43.388   569   629 W VoiceInteractionManager: no available voice recognition services found for user 0
11-12 12:29:43.392   855  3033 I PermissionControllerServiceImpl: Updating user sensitive for uid 10106
11-12 12:29:43.410  1064  1064 D CarrierSvcBindHelper: No carrier app for: 0
11-12 12:29:43.411  1064  1064 D CarrierSvcBindHelper: No carrier app for: 0
11-12 12:29:43.418  1064  1064 D ImsResolver: maybeAddedImsService, packageName: net.twisterrob.colorfilters.android.base.test
11-12 12:29:43.420  1064  1064 D CarrierConfigLoader: mHandler: EVENT_PACKAGE_CHANGED phoneId: 0
11-12 12:29:43.456   569   580 I system_server: Background concurrent copying GC freed 214052(11MB) AllocSpace objects, 41(2332KB) LOS objects, 49% free, 12MB/24MB, paused 587us total 109.336ms
11-12 12:23:01.159     0     0 I logd    : logdr: UID=2000 GID=2000 PID=4828 b tail=0 logMask=1 pid=0 start=1668256183000000000ns deadline=0ns
11-12 12:29:43.827  4882  4882 D AndroidRuntime: >>>>>> START com.android.internal.os.RuntimeInit uid 2000 <<<<<<
11-12 12:29:43.831  4882  4882 I AndroidRuntime: Using default boot image
11-12 12:29:43.831  4882  4882 I AndroidRuntime: Leaving lock profiling enabled
11-12 12:29:43.832  4882  4882 W libc    : Access denied finding property "odsign.verification.success"
11-12 12:29:43.833  4882  4882 W app_process: ART APEX data files are untrusted.
11-12 12:29:43.833  4882  4882 I app_process: Core platform API reporting enabled, enforcing=false
11-12 12:29:43.831  4882  4882 W app_process: type=1400 audit(0.0:35): avc: denied { read } for name="u:object_r:odsign_prop:s0" dev="tmpfs" ino=205 scontext=u:r:shell:s0 tcontext=u:object_r:odsign_prop:s0 tclass=fi
le permissive=0
11-12 12:29:43.894  4882  4882 D app_process: Time zone APEX ICU file found: /apex/com.android.tzdata/etc/icu/icu_tzdata.dat
11-12 12:29:43.894  4882  4882 D app_process: I18n APEX ICU file found: /apex/com.android.i18n/etc/icu/icudt68l.dat
11-12 12:29:43.901  4882  4882 W app_process: Unexpected CPU variant for X86 using defaults: x86_64
11-12 12:29:43.914  4882  4882 D AndroidRuntime: Calling main entry com.android.commands.am.Am
11-12 12:29:43.918   569   672 I ActivityManager: Force stopping net.twisterrob.colorfilters.android.base.test appid=10106 user=0: start instr
11-12 12:29:43.920   569   672 D CompatibilityChangeReporter: Compat change id reported: 135634846; UID 10106; state: DISABLED
11-12 12:29:43.921   569   672 D CompatibilityChangeReporter: Compat change id reported: 177438394; UID 10106; state: DISABLED
11-12 12:29:43.921   569   672 D CompatibilityChangeReporter: Compat change id reported: 135772972; UID 10106; state: DISABLED
11-12 12:29:43.921   569   672 D CompatibilityChangeReporter: Compat change id reported: 135754954; UID 10106; state: ENABLED
11-12 12:29:43.922   569   631 D CompatibilityChangeReporter: Compat change id reported: 143937733; UID 10106; state: ENABLED
11-12 12:29:43.926   366   366 D Zygote  : Forked child process 4896
11-12 12:29:43.926   569   631 I ActivityManager: Start proc 4896:net.twisterrob.colorfilters.android.base.test/u0a106 for added application net.twisterrob.colorfilters.android.base.test
11-12 12:29:43.930  4896  4896 I droid.base.tes: Late-enabling -Xcheck:jni
11-12 12:29:43.943  4896  4896 W droid.base.tes: Unexpected CPU variant for X86 using defaults: x86_64
11-12 12:29:43.949   463   498 I adbd    : jdwp connection from 4896
11-12 12:29:43.975  4896  4896 D CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10106; state: DISABLED
11-12 12:29:43.980  4896  4896 D ApplicationLoaders: Returning zygote-cached class loader: /system/framework/android.test.base.jar
11-12 12:29:43.983  4896  4896 D ApplicationLoaders: Returning zygote-cached class loader: /system/framework/android.test.base.jar
11-12 12:29:43.983  4896  4896 W droid.base.tes: ClassLoaderContext shared library size mismatch. Expected=0, found=2 (PCL[] | PCL[]{PCL[/system/framework/android.test.base.jar*3790657674]#PCL[/system/framework/andr
oid.test.mock.jar*3278543460]})
11-12 12:29:44.105  4896  4896 V GraphicsEnvironment: ANGLE Developer option for 'net.twisterrob.colorfilters.android.base.test' set to: 'default'
11-12 12:29:44.105  4896  4896 V GraphicsEnvironment: Neither updatable production driver nor prerelease driver is supported.
11-12 12:29:44.121  4896  4896 D NetworkSecurityConfig: No Network Security Config specified, using platform default
11-12 12:29:44.122  4896  4896 D NetworkSecurityConfig: No Network Security Config specified, using platform default
11-12 12:29:44.137  4896  4896 I MonitoringInstr: Instrumentation started!
11-12 12:29:44.145  4896  4896 D AndroidRuntime: Shutting down VM
--------- beginning of crash
11-12 12:29:44.146  4896  4896 E AndroidRuntime: FATAL EXCEPTION: main
11-12 12:29:44.146  4896  4896 E AndroidRuntime: Process: net.twisterrob.colorfilters.android.base.test, PID: 4896
11-12 12:29:44.146  4896  4896 E AndroidRuntime: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/test/platform/io/PlatformTestStorageRegistry;
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        at androidx.test.internal.runner.RunnerArgs$Builder.<init>(RunnerArgs.java:248)
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        at androidx.test.runner.AndroidJUnitRunner.parseRunnerArgs(AndroidJUnitRunner.java:393)
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        at androidx.test.runner.AndroidJUnitRunner.onCreate(AndroidJUnitRunner.java:302)
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6717)
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        at android.app.ActivityThread.access$1500(ActivityThread.java:247)
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2053)
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:106)
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        at android.os.Looper.loopOnce(Looper.java:201)
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:288)
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:7839)
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
11-12 12:29:44.146  4896  4896 E AndroidRuntime: Caused by: java.lang.ClassNotFoundException: Didn't find class "androidx.test.platform.io.PlatformTestStorageRegistry" on path: DexPathList[[zip file "/data/app/~~3KM
XhtHVNrLFH65gyRQXlg==/net.twisterrob.colorfilters.android.base.test-gvJmr7KtnL3D9DVECQ07Qw==/base.apk"],nativeLibraryDirectories=[/data/app/~~3KMXhtHVNrLFH65gyRQXlg==/net.twisterrob.colorfilters.android.base.test-gv
Jmr7KtnL3D9DVECQ07Qw==/lib/x86_64, /system/lib64, /system_ext/lib64]]
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:218)
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
11-12 12:29:44.146  4896  4896 E AndroidRuntime:        ... 13 more

AndroidX Test and Android OS Versions

androidx-test = "1.5.0"
androidx-test-espresso = "3.5.0"
Emulator API 31, 29

Link to a public git repo demonstrating the problem:

See repro above.

@brettchabot
Copy link
Collaborator

Thanks for the report. I can repro on your project, but attempting to replicate the same scenario on https://github.com/android/testing-samples/tree/main/ui/espresso/FragmentScenarioSample always immediately fails with a build error. Cannot find a version of 'androidx.test:core' that satisfies the version constraints
https://github.com/android/testing-samples/compare/fragmentscenariomismatch?expand=1

Sorry I'm not very experienced with gradle and am not able to follow your project's setup to see what the differences are.
Any ideas?

@ZOlbrys
Copy link

ZOlbrys commented Nov 15, 2022

Same experience on my private project, +1. connectedDebugAndroidTest never completed (my CI build testing this update ran for hours until I manually killed it) and there was no output in console explaining something might be wrong. Logcat did show the same error that you posted above though, which led me to here.

I believe any instrumentation test (not just connectedDebugAndroidTest task) would not complete, btw.

If it was failing instantly with a meaningful error message, maybe it had to do with some sort of caching issue, but I'm also no gradle expert... just an early updater :P

@brettchabot
Copy link
Collaborator

@yuuki3655 any ideas?

@QArtur99
Copy link

QArtur99 commented Nov 16, 2022

"androidx.test.platform.io.PlatformTestStorageRegistry" is part of androidx.test:monitor:1.6.0
to solve this issue you have to add:
debugImplementation "androidx.test:monitor:1.6.0"

@brettchabot
Copy link
Collaborator

@TWiStErRob would you mind filing this against gradle instead? https://developer.android.com/studio/report-bugs. There is not much we can do on the androidx.test.runner side to handle a low level class missing exception this early in the run, and filing against gradle will ensure we can get the experts to look at it.

I'm of the opinion there are two bugs here:

  1. gradle should fail at build time with a Cannot find a version of 'androidx.test:core' that satisfies the version constraints for your project too
  2. The gradle test runner hangs indefinitely on an instrumentation test crash. Looking at the jstack output, it seems it waiting forever for a adb shell response
"main" #1 prio=5 os_prio=31 cpu=738.04ms elapsed=30.16s tid=0x000000014e00c800 nid=0x1203 waiting on condition  [0x000000016b16c000]
   java.lang.Thread.State: TIMED_WAITING (parking)
...
	at com.android.tools.utp.plugins.deviceprovider.ddmlib.DdmlibAndroidDeviceController$executeAsync$1.waitFor(DdmlibAndroidDeviceController.kt:243)
	at com.google.testing.platform.runtime.android.driver.AndroidInstrumentationDriver.runTestSuite(AndroidInstrumentationDriver.kt:253)
	at com.google.testing.platform.runtime.android.driver.AndroidInstrumentationDriver.run(AndroidInstrumentationDriver.kt:180)


@kubovy
Copy link

kubovy commented Dec 28, 2023

@QArtur99 comment brought me to the right path although I didn't have to add the debug dependency after all. After updating some androidx dependencies this issue occurred. I am using minified debug build for testing:

buildTypes {
    debug {
        minifyEnabled true
        shrinkResources true
    }
   # ...
}

So I needed to add the following tomy proguard rules:

-keep interface androidx.test.platform.io.PlatformTestStorage {
    void addOutputProperties(java.util.Map);
    *** getInputArgs();
}
-keep class androidx.test.platform.io.PlatformTestStorageRegistry {
    static *** getInstance();
}
-keep class androidx.test.platform.tracing.Tracing {
    static *** getInstance();
    *** beginSpan(...);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants