android-test
android-test copied to clipboard
Library source does not match the byte code
For some classes, like ViewInteraction
or RootViewPicker
, IDE reports that library source doesn't match the byte code:
This makes it quite difficult to debug issues step by step
Espresso 3.2.0
Same Problem
This is likely because jarjar is used to shade Guava deps during the build, that seems to mess up the debug symbols/line numbers in the resulting class files.
https://github.com/android/android-test/blob/45073bc6751ab0c5cb5cb2349fab1610971735ef/espresso/core/java/androidx/test/espresso/remote/release_jarjar_rules.txt#L1
I confirmed that removing jarjar
fixes this.
I downloaded and build the code locally with jarjar disabled, and this problem goes away.
A couple of options to fix this:
- Fix
jarjar
so that it keeps line numbers intact, and the published-sources.jar
matches the published.jar
- Remove
jarjar
- The guava usages can be fairly easily removed and replaced with kotlin or inline copy/paste from Guava.
- The Dagger usage can just be declared as a proper transitive dep.
- Convert the build to
gradle
like the rest of AndroidX and either don't shadow anything or use theshadow
plugin.
Please give espresso 3.6.0-alpha01 a try. It still uses jarjar to rename dagger, but guava has been removed entirely.