androidandroid-studiobaseline-profilemacrobenchmark

getting error "Cannot locate tasks that match ':app:generateBenchmarkReleaseBaselineProfile'" error when running baseline profiler


After creating a new BaselineProfile module, I tried to execute the task:

enter image description here

and I'm getting the following error:
Cannot locate tasks that match ':app:generateBenchmarkReleaseBaselineProfile' as task 'generateBenchmarkReleaseBaselineProfile' not found in project ':app'.

I'm not seeing any configuration instructions for this in the online docs for baseline profiles. Any clues?


Solution

  • The error is because you are using benchmarkRelease build variant. Instead, just use release build variant and try again