nowinandroid icon indicating copy to clipboard operation
nowinandroid copied to clipboard

[Bug]: BaselineProfile automaticGenerationDuringBuild fails with instrumentation error on release build

Open jtm0609 opened this issue 4 months ago • 0 comments

Is there an existing issue for this?

  • [x] I have searched the existing issues

Is there a StackOverflow question about this issue?

  • [x] I have searched StackOverflow

What happened?

Hello, I downloaded the Now in Android repository to test the automaticGenerationDuringBuild property of the baseline profile, and I attempted to create a signed app bundle by running a release build. As far as I know, when this property is set to true, a Baseline Profile should be automatically generated during the release build. However, when I actually ran it, I encountered the following build errors in the Task execution. How can this be resolved?

Relevant logcat output

**1. Instrumentation Error**
 > Task :benchmarks:pixel6Api33ProdNonMinifiedReleaseAndroidTest
Test run failed to complete. Unable to find instrumentation info for: ComponentInfo{com.google.samples.apps.nowinandroid.benchmarks/androidx.test.runner.AndroidJUnitRunner}

> Task :benchmarks:pixel6Api33ProdNonMinifiedReleaseAndroidTest FAILED

Execution failed for task ':benchmarks:pixel6Api33ProdNonMinifiedReleaseAndroidTest'.
> There were failing tests. See the report at: file:///Users/jeongtaegmin/Desktop/AndroidStudio/now-test/benchmarks/build/reports/androidTests/managedDevice/nonminifiedrelease/flavors/prod/pixel6Api33/index.html

**2. Gradle Dependency Error**
A problem was found with the configuration of task ':app:createProdNonMinifiedReleaseApkListingFileRedirect' (type 'ListingFileRedirectTask').
  - Gradle detected a problem with the following location: '/Users/jeongtaegmin/Desktop/AndroidStudio/now-test/app/prod/nonMinifiedRelease/output-metadata.json'.
    
    Reason: Task ':app:createProdNonMinifiedReleaseApkListingFileRedirect' uses this output of task ':benchmarks:packageProdNonMinifiedRelease' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
    
    Possible solutions:
      1. Declare task ':benchmarks:packageProdNonMinifiedRelease' as an input of ':app:createProdNonMinifiedReleaseApkListingFileRedirect'.
      2. Declare an explicit dependency on ':benchmarks:packageProdNonMinifiedRelease' from ':app:createProdNonMinifiedReleaseApkListingFileRedirect' using Task#dependsOn.
      3. Declare an explicit dependency on ':benchmarks:packageProdNonMinifiedRelease' from ':app:createProdNonMinifiedReleaseApkListingFileRedirect' using Task#mustRunAfter.
    
    For more information, please refer to https://docs.gradle.org/9.0.0/userguide/validation_problems.html#implicit_dependency in the Gradle documentation.

Code of Conduct

  • [x] I agree to follow this project's Code of Conduct

jtm0609 avatar Sep 24 '25 00:09 jtm0609