Status Update
Comments
sm...@google.com <sm...@google.com>
sm...@google.com <sm...@google.com>
mc...@ebay.com <mc...@ebay.com> #2
Another thing which may cause issues with testFixtures
use in com.android.test
modules:
Test fixture configurations by default include a dependency upon the project they are defined in. Although the render doesn't indicate the classifiers, a gradle dependencies dump in the attached project demonstrates this:
+--- project :sampleLib
| \--- project :sampleLib (*)
In the com.android.test
modules this would result in the production code being included (also) in the test implementation dependencies which would cause the production classes to wind up in the test APK. This would result in class duplication which would then cause split- classloader issues during test execution.
If this can't be resolved on the AGP side, the following pattern might suffice as a workaround:
implementation testFixtures(project(":sampleLib")) {
exclude module: 'sampleLib'
}
Mentioning this here because I'm not sure where the line of responsibility would fall in this scenario...
sm...@google.com <sm...@google.com>
mc...@ebay.com <mc...@ebay.com> #3
One last addition: Although the repro project doesn't manifest this, our non-reduced project seems to have issues with the com.android.test
module seeing dependency library test fixture code as well. i.e., take my library module's test fixture then this appears to work ok
with a grain of salt...
mc...@ebay.com <mc...@ebay.com> #5
Thanks for the update. Is there any hope of getting it back-ported to the 7.2 lineage? We've got some users who are wanting access to the compose updates in AS Chipmunk and this is a blocker for us to get there.
am...@google.com <am...@google.com> #6
Unfortunately it's too late now to have this in a 7.2 batch release. However, 7.3 release candidate should be released within couple of weeks and stabilized within a month.
mc...@ebay.com <mc...@ebay.com> #7
Ok, thanks for the update.
de...@google.com <de...@google.com> #8
Thank you for your patience while our engineering team worked to resolve this issue. A fix for this issue is now available in:
- Android Studio Dolphin Beta 5 (2021.3.1.14)
- Android Gradle Plugin 7.3.0-beta05
We encourage you to try the latest update.
If you notice further issues or have questions, please file a new bug report.
Thank you for taking the time to submit feedback — we really appreciate it!
Description
DESCRIBE THE ISSUE IN DETAIL:
Sample project attached.
The issue appears to be that app modules which leverage test fixtures to share code with
com.android.test
modules fails to be correctly included into the test APK. This causes thecom.android.test
module tests to crash withNoClassDefFoundError
s.If the
com.android.test
module refers to a library module's test fixture then this appears to work ok.AndroidStudio can see the classes from the app module's test fixture correctly.
This is causing heartache due to AS Chipmunk being based upon a version of IntelliJ that treats source files referenced by more than one project module as an error, causing our previous approach of using manual source set definitions referring to the test fixture source to no longer work well. Thus, we might be stuck on Bumblebee/7.1 until this gets fixed.
STEPS TO REPRODUCE:
./gradlew :appTests:connectedCheck
Studio Build: Chipmunk | 2021.2.1 Patch 1 Version of Gradle Plugin: 7.2.1 Version of Gradle: 7.4.2 (repro project uses 7.3.3) Version of Java: 11.0.14 (Azul Systems, Inc. 11.0.14+9-LTS) OS: Mac OS X 12.4 aarch64