Fixed
Status Update
Comments
sp...@google.com <sp...@google.com>
an...@google.com <an...@google.com> #3
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 Ladybug Feature Drop | 2024.2.2 Canary 6
- Android Gradle Plugin 8.8.0-alpha06
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
In trying to sethttps://developer.android.com/training/testing/local-tests#error in agp-kmp I have found it does not prevent the reported test errors.
unitTests.returnDefaultValues = true
as perIn normal AGP, you set this on
UnitTestOptions
through aCommonExtension
. I believe in AGP-KMP, you are supposed to set this directly onKotlinMultiplatformAndroidTestOnJvm
. However, I have tried settingin both
build.gradle
andbuildSrc
(where I can watch it be applied in the debugger) and it doesn't appear to fix the issue.This problem is observed when applying the diff in this file to androidx, and running
:compose:runtime:runtime:testAndroidTestOnJvm
.My best guess is that
isReturnDefaultValues
is not propagating properly at some point? As mentioned in chat, there are apparently no tests for this case.Perhaps related is that , and privately in ?
returnDefaultValues
appears to be defined in two places, publicly in DSL inKotlinMultiplatformAndroidTestOnJvm
KmpUnitTestOptionsDslInfoImpl
The simplest workaround would normally be to add
robolectric
to theandroidUnitTest
sourceSet and tests in question, but in the case I've been looking at (compose-runtime
) several of the tests are defined at thecommon
level, and we can't add the robolectric test runner in a non-jvmcommon
sourceSet.