Open janaltenhof opened 1 year ago
I could not reproduce this locally. Sometimes this happens when the screen turns off during benchmarking. Make sure the display time out is set long enough.
Please @keyboardsurfer, reactivate this issue, since I'm getting this error over the following run configuration. Android Studio Iguana | 2023.2.1 Canary 7 AGP = 8.0.0 androidx-baselineprofile = "1.2.0-alpha13" profileinstaller = "1.3.0"
running task
./gradlew :app:generateReleaseBaselineProfile -Pandroid.testInstrumentationRunnerArguments.androidx.benchmark.enabledRules=BaselineProfile --info
SEVERE: Execute com.google.baselineprofile.BaselineProfileGenerator.generate: FAILED
androidx.test.uiautomator.StaleObjectException
at androidx.test.uiautomator.UiObject2.getAccessibilityNodeInfo(UiObject2.java: androidx.test.uiautomator.StaleObjectException
at androidx.test.uiautomator.UiObject2.getAccessibilityNodeInfo(UiObject2.java:647)
at androidx.test.uiautomator.UiObject2.getVisibleBounds(UiObject2.java:213)
at androidx.test.uiautomator.UiObject2.getVisibleCenter(UiObject2.java:264)
at androidx.test.uiautomator.UiObject2.click(UiObject2.java:356)
at com.google.baselineprofile.BaselineProfileGeneratorKt.goToSnackDetailJourney(BaselineProfileGenerator.kt:87)
at com.google.baselineprofile.BaselineProfileGenerator$generate$1.invoke(BaselineProfileGenerator.kt:58)
at com.google.baselineprofile.BaselineProfileGenerator$generate$1.invoke(BaselineProfileGenerator.kt:42)
at androidx.benchmark.macro.BaselineProfilesKt$collectBaselineProfile$1$1.invoke(BaselineProfiles.kt:68)
at androidx.benchmark.macro.BaselineProfilesKt$collectBaselineProfile$1$1.invoke(BaselineProfiles.kt:62)
at androidx.benchmark.macro.CompilationMode$Partial.compileImpl$benchmark_macro_release(CompilationMode.kt:319)
at androidx.benchmark.macro.CompilationMode.resetAndCompile$benchmark_macro_release(CompilationMode.kt:115)
at androidx.benchmark.macro.BaselineProfilesKt.collectBaselineProfile(BaselineProfiles.kt:62)
at androidx.benchmark.macro.junit4.BaselineProfileRule.collectBaselineProfile(BaselineProfileRule.kt:131)
at androidx.benchmark.macro.junit4.BaselineProfileRule.collectBaselineProfile$default(BaselineProfileRule.kt:123)
at com.google.baselineprofile.BaselineProfileGenerator.generate(BaselineProfileGenerator.kt:42)
androidx.test.uiautomator.StaleObjectException
at androidx.test.uiautomator.UiObject2.getAccessibilityNodeInfo(UiObject2.java:647)
at androidx.test.uiautomator.UiObject2.getVisibleBounds(UiObject2.java:213)
at androidx.test.uiautomator.UiObject2.getVisibleCenter(UiObject2.java:264)
at androidx.test.uiautomator.UiObject2.click(UiObject2.java:356)
at com.google.baselineprofile.BaselineProfileGeneratorKt.goToSnackDetailJourney(BaselineProfileGenerator.kt:87)
at com.google.baselineprofile.BaselineProfileGenerator$generate$1.invoke(BaselineProfileGenerator.kt:58)
at com.google.baselineprofile.BaselineProfileGenerator$generate$1.invoke(BaselineProfileGenerator.kt:42)
at androidx.benchmark.macro.BaselineProfilesKt$collectBaselineProfile$1$1.invoke(BaselineProfiles.kt:68)
at androidx.benchmark.macro.BaselineProfilesKt$collectBaselineProfile$1$1.invoke(BaselineProfiles.kt:62)
at androidx.benchmark.macro.CompilationMode$Partial.compileImpl$benchmark_macro_release(CompilationMode.kt:319)
at androidx.benchmark.macro.CompilationMode.resetAndCompile$benchmark_macro_release(CompilationMode.kt:115)
at androidx.benchmark.macro.BaselineProfilesKt.collectBaselineProfile(BaselineProfiles.kt:62)
at androidx.benchmark.macro.junit4.BaselineProfileRule.collectBaselineProfile(BaselineProfileRule.kt:131)
at androidx.benchmark.macro.junit4.BaselineProfileRule.collectBaselineProfile$default(BaselineProfileRule.kt:123)
at com.google.baselineprofile.BaselineProfileGenerator.generate(BaselineProfileGenerator.kt:42)
Update @janaltenhof: By updating the following configuration I made it work.
testOptions.managedDevices.devices {
create<ManagedVirtualDevice>("pixel6Api30") {
device = "Pixel 6"
apiLevel = 30 // CHANGED FROM 31 TO 30, (32 DIDN'T WORK)
systemImageSource = "aosp"
}
}
Additional note, the following configuration, testing on a physical device using API 34 (Android 14), didn't work. baselineProfile { // managedDevices += "pixel6Api30" useConnectedDevices = true }
We're working on addressing this within the Macrobenchmark library itself.
In the meantime we recommend running the tests again in case they fail with a StaleObjectException
.
Hi, when I want to run the Baseline Profile Generator in step 7 of the codelab I'm getting this error. I don't know what to do? Can you help me?