There was a problem collecting hot code using the Baseline Profile

105 Views Asked by At

I hope you can help me, I created the Benchmark module in Android Studio, he has helped me set up the required things, my project is multi-channel, package name I have set and correct: the code is:

@OptIn(ExperimentalBaselineProfilesApi::class)
class TrivialBaselineProfileBenchmark {
    // [START baseline_profile_basic]
    @get:Rule
    val baselineProfileRule = BaselineProfileRule()

    @Test
    fun startup() = baselineProfileRule.collectBaselineProfile(
        packageName = " com.xxx.xxx,
        profileBlock = {
            startActivityAndWait()
            device.waitForIdle()
        }
    )
    // [END baseline_profile_basic]
}

enter image description here

Then I get the following error when I use it: enter image description here

1

There are 1 best solutions below

0
On

It looks like the library can't find the app with the specified packageName.

It is quite common to define some suffix based on build variant, so make sure your build variant uses the same package name as the packageName parameter.