Fixed
Status Update
Comments
sp...@google.com <sp...@google.com>
sp...@google.com <sp...@google.com> #2
I don't think the average developer understands the distinction between method references and method definitions in this context (inside a DEX file). I know I don't.
@jvg, can you elaborate?
an...@google.com <an...@google.com> #3
people who are looking at the bytecode in the dex to optimize their app through shrinking hopefully will learn the difference as string tables for method references between various dex files can account for quite a bit of disk space. but more importantly a definition is something you can analyze its code for where a reference you can't so the UI can be confusing without seeing the difference
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.