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]
}
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.