Status Update
Comments
cc...@google.com <cc...@google.com>
ma...@google.com <ma...@google.com>
ma...@google.com <ma...@google.com> #2
The workaround I found so far is to use project.afterEvaluate {} to access the build types, as they are created only after Baseline Profile Gradle Plugin creates them:
Kotlin
android {
buildTypes {
release { ... }
project.afterEvaluate {
getByName("benchmarkRelease") { }
getByName("nonMinifiedRelease") { }
}
}
}
Groovy
android {
buildTypes {
release { ... }
project.afterEvaluate {
benchmarkRelease { }
nonMinifiedRelease { }
}
}
}
This way there are no redundant build variants created.
ga...@linecorp.com <ga...@linecorp.com> #3
Attaching a sample project for convenience.
ga...@linecorp.com <ga...@linecorp.com> #4
This should be a bug on the AS side.
ga...@linecorp.com <ga...@linecorp.com> #5
I would say AS isn't the problem. Even without the AS in the project that I attached the simple commands:
./gradlew assembleBenchmarkBenchmarkRelease
./gradlew assembleNonMinifiedNonMinifiedRelease
./gradlew assembleNonMinifiedBenchmarkRelease
are executed successfully and produce some apks.
ma...@google.com <ma...@google.com> #6
This is how the baseline profile works - it creates specific build types to correctly generate baseline profiles and benchmarks.
You can still disable the variants if you're not interested in one of them. But AS should not be showing them (by default, configurable through a flag).
ap...@google.com <ap...@google.com> #7
Yes, the Baseline Profile Gradle Plugin creates the appropriate build types or updates them if they already exist (or supposed to, according to the source code).
What I'm refereing to exactly is those result build variants, that don't make sence: benchmarkBenchmarkRelease
, nonMinifiedNonMinifiedRelease
and nonMinifiedBenchmarkRelease
.
AS displays whatever build variants were created by the gradle plugins and fixing this issue either on AS side or disabling all these weird build variants manually in build script seem more like treating a symptom, rather than the root cause.
pr...@google.com <pr...@google.com> #8
AS does hide these variants, but the Android Gradle Plugin needs to be 8.6.0.alpha01
or higher. We use variant's experimental properties as a flag to hide these variants and 8.6.0.alpha01
is the AGP version our model recognizes those flags.
Could you try bumping the AGP version? The attached project uses 8.5.2.
Description
Continuing report from b/307473787
I tried to followhttps://developer.android.com/topic/performance/baselineprofiles/create-baselineprofile#create-new-profile
And applied
androidx.baselineprofile
gradle plugin on my project.But when I tried to perform gradle, and gradle failed like this.
Component used:
Devices/Android versions reproduced on: N/A
If this is a bug in the library, we would appreciate if you could attach: