android / android-test

An extensive framework for testing Android apps
https://android.github.io/android-test
Apache License 2.0
1.16k stars 315 forks source link

Cherry pick 'Fix ActivityInvoker$-CC class not found errors' to axt_2024_05_14_stable_release_branch #2267

Closed brettchabot closed 3 months ago

brettchabot commented 3 months ago

Builds using ActivityScenario with older androidx.test.core:1.5.X but the latest androidx.test:monitor:1.7.X will see ActivityInvoker$-CC class not found errors. This is because androidx.test.core:1.5.X effectively depends on internal classes generated by the desugaring tool.

The latest androidx.test toolchain generates java8 bytecode and no longer generates these desugared classes.

To fix the backwards compatibility issues, this commit introduces a placeholder class ActivityInvokerDesugar that gets renamed to the missing ActivityInvoker$-CC class at build time.

Fixes #2259.