CLOVIS
04/16/2023, 6:13 PMMethod beginSection in android.os.Trace not mocked. See <http://g.co/androidstudio/not-mocked> for details.java.lang.RuntimeException: Method beginSection in android.os.Trace not mocked. See <http://g.co/androidstudio/not-mocked> for details.
The link is broken. It happens when executing the JVM unit tests.Dima Avdeev
04/16/2023, 8:09 PMCLOVIS
04/17/2023, 8:03 AMmain
branch, run ./gradlew check
One of the unit tests fails, in the test report the following stacktrace is shown:
java.lang.RuntimeException: Method beginSection in android.os.Trace not mocked. See <http://g.co/androidstudio/not-mocked> for details.
at android.os.Trace.beginSection(Trace.java)
at androidx.compose.runtime.Trace.beginSection(ActualAndroid.android.kt:30)
at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:4495)
at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:3173)
at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:587)
at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:950)
at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:519)
Looking at it again, I'm not sure it's a desktop or android issue 😕Landry Norris
04/17/2023, 11:03 PMLandry Norris
04/17/2023, 11:15 PMLandry Norris
04/17/2023, 11:39 PMDima Avdeev
04/18/2023, 7:10 AMCLOVIS
04/18/2023, 7:13 AMDima Avdeev
04/18/2023, 7:18 AM./gradlew demo:jvmTest
and it works fineDima Avdeev
04/18/2023, 7:20 AMDima Avdeev
04/18/2023, 7:20 AM./gradlew jvmTest
for Desktop testsCLOVIS
04/18/2023, 8:54 AM./gradlew check
or ./gradlew allTests
with compose multiplatform?Landry Norris
04/18/2023, 1:16 PMLandry Norris
04/18/2023, 1:19 PMHackintoshfive
04/20/2023, 10:15 AMTrace
class is used for performance logging, so you can ignore it. In your test sources, create a class named android.os.Trace and implement a method named beginSection
with the right signature https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/j[…]Trace.java;l=396;drc=1a382346dffa81623bcf4496fc41b9b83588e90e. You'll also need to implement endTrace and probably some other methods too.CLOVIS
04/20/2023, 12:02 PM