5

I have created a benchmark module and within its build.gradle file I have added a managed device as following:

testOptions {
        managedDevices {
            devices {
                pixel2api30 (com.android.build.api.dsl.ManagedVirtualDevice) {
                    device = "Pixel 2"
                    apiLevel = 30
                    systemImageSource = "aosp"
                    require64Bit = false
                }
            }
        }
    }

Whenever I run the command gradle :benchmark:pixel2api30Setup its working

But when I run the command gradle :benchmark:pixel2api30BenchmarkAndroidTest

It throws the following error:

Task 'pixel2api30BenchmarkAndroidTest' not found in project ':benchmark'.
mlykotom
  • 4,850
  • 1
  • 22
  • 27
nayan dhabarde
  • 1,734
  • 1
  • 19
  • 38
  • Facing same issue. I can see the pixel2api30Check task in tasks list, however instrumentation command is not found within benchmark project. I am using AGP 7.2.2 Were you able to resolve this? – ZealDeveloper Aug 25 '22 at 16:35

1 Answers1

3

Which version of AGP are you using?

I was getting similar error but after upgrading AGP to 7.3.0-alpha07 from 7.2.2, I can now run the benchmark instrumentation task.

As stated in the release preview notes:

Make sure your project is using AGP version 7.3.0-alpha07 or higher.

https://developer.android.com/studio/preview/features?hl=fr

ZealDeveloper
  • 783
  • 5
  • 21