Stylianos Gakis
01/31/2023, 10:20 AMtest
directory and not in the androidTest
meaning that they are unit tests. However when trying to run locally a test that looks exactly like one in there, (after also including robolectric if that’s important), I get
'void android.os.Trace.beginSection(java.lang.String)'
java.lang.NoSuchMethodError: 'void android.os.Trace.beginSection(java.lang.String)'
...
As I understand, unit tests don’t have access to Tracer since it’s a android.os
class, but I thought maybe robolectric is the missing piece here.
But there must be some other piece I am missing or something I am completely misunderstanding. Does someone know about this who can help me out by explaining a bit here?Albert Chang
01/31/2023, 4:53 PMStylianos Gakis
01/31/2023, 5:35 PMmattinger
01/31/2023, 7:56 PM@Config
annotation to select a. particular sdk version (or you can do it in robolectric.properties file)Stylianos Gakis
01/31/2023, 9:11 PM@Config(sdk = [28])
and it did run and work actually! It didn’t work with sdk 33 or 32, don’t know the details here, never used robolectric before.
I didn’t see either of these options in the ComposeModifierTest I linked above, but I guess those are setup somewhere else, not in this file.
Thanks a lot for the help!