Status Update
Comments
ch...@google.com <ch...@google.com>
ta...@gmail.com <ta...@gmail.com> #3
Actually these transforms are only ~40% of the time spend in there, but it's still a hot spot that we should resolve by not using a FileCollection
sg...@google.com <sg...@google.com> #4
xav@ could you assign this bug to someone to make sure it gets fixed?
cl...@google.com <cl...@google.com> #5
Jerome will do that for you :)
cl...@google.com <cl...@google.com> #6
Bingran, can you have a look at this asap. thx !
ta...@gmail.com <ta...@gmail.com> #7
To make sure I analyze the "buildOnServer-7.5-rc-2-2022-07-01-shutdown.snapshot" correctly, I attached a screenshot of how I find the concerning point. From the picture, the MergeGeneratedProguardFilesCreationAction takes 1924ms. Is that the right way to check your snapshot file? If so, what is the expected time for that creation action in a config cached build?
ta...@gmail.com <ta...@gmail.com> #8
I think you missed adding an attachment.
cl...@google.com <cl...@google.com> #9
oops, here it is =)
ap...@google.com <ap...@google.com> #10
From discussions with xav@ that time should almost be non-existent during the run when the configuration cache kicks in.
ta...@gmail.com <ta...@gmail.com> #11
cl...@google.com <cl...@google.com> #12
I checked out androidx-main, is that the right one? There is no gradlew file under that directory.
Yes, aosp androidx-main is the repo. You'll want to use frameworks/support/gradlew
thats the main repo all the work is done.
And have you ever tried building androidx with the dev version of AGP(the one built from studio-main)?
Yes we have a script for that
namely you can set a number of variables to use the latest AGP (
- GRADLE_PLUGIN_VERSION
- LINT_VERSION
- GRADLE_PLUGIN_REPO
and then run frameworks/support/gradlew
ta...@gmail.com <ta...@gmail.com> #13
I believe this issue can be fixed by Jerome'CL ag/19955912. I got 4 snapshots running androidx to verify the fix.
- the first run without the fix
- the second run(config cached) without the fix
- the first run with the fix
- the second run(config cached) with the fix
From the snapshot of secondWithFix_xxx
, if we do a search for MergeGeneratedProguardFilesCreationAction
in the call tree, nothing would show up. However, if we do the same search for secondWithoutFix_xx
, 3612ms is spent inside MergeGeneratedProguardFilesCreationAction
.
The fix also reduce the time spent in non config cached run if we compare the same thing for firstWithoutFix_xxx
and firstWithFix_xxx
cl...@google.com <cl...@google.com> #14
Great bug Aurimas, very useful to get such bugs filed.
cl...@google.com <cl...@google.com> #15
Verified again for the latest patch of ag/19955912. The snapshot of the config cached run and the screenshot of the search result of the MergeGeneratedProguardFilesCreationAction
are attached. With the fix, the MergeGeneratedProguardFilesCreationAction
would only take a 8 ms which is close to zero.
ap...@google.com <ap...@google.com> #16
Branch: main
commit af29744fd0bbac05db78de171b3fc2e67afb8b19
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Mon Feb 06 13:43:09 2023
Avoid synthesis of unused methods in default interface method desugaring
Bug:
Bug:
Bug:
Change-Id: Iebe2fb88ef7aca337f8db34aba18b81aaa953617
M src/main/java/com/android/tools/r8/ir/desugar/itf/ClassProcessor.java
cl...@google.com <cl...@google.com> #17
Needs backport to 4.0 and 8.0.
ap...@google.com <ap...@google.com> #18
Branch: main
commit f35ec2083c5b5880f59fe141c4a12f15c6e3f230
Author: Clément Béra <clementbera@google.com>
Date: Mon Feb 06 11:10:11 2023
Desugared library: don't generate callbacks for dead methods
Bug:
Change-Id: I1497363ceab5842f7e09f7fc604c794a49b02ffb
M src/main/java/com/android/tools/r8/ir/conversion/IRConverter.java
M src/main/java/com/android/tools/r8/ir/desugar/CfPostProcessingDesugaringCollection.java
M src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/apiconversion/DesugaredLibraryAPICallbackSynthesizer.java
M src/main/java/com/android/tools/r8/shaking/Enqueuer.java
A src/test/java/com/android/tools/r8/desugar/desugaredlibrary/GuavaMultiSetSpliteratorTest.java
cl...@google.com <cl...@google.com> #19
Can you try:
pluginManagement {
buildscript {
repositories {
mavenCentral()
maven {
url = uri("https://storage.googleapis.com/r8-releases/raw/main")
}
}
dependencies {
classpath("com.android.tools:r8:f35ec2083c5b5880f59fe141c4a12f15c6e3f230")
}
}
}
Does it compile for you?
ta...@gmail.com <ta...@gmail.com> #20
Yes, everything is working great now!
ap...@google.com <ap...@google.com> #21
Branch: main
commit 9952fea15e2abee802e180706695bffb8dabed99
Author: Clément Béra <clementbera@google.com>
Date: Tue Feb 07 11:22:59 2023
Fix live method computation in api callback synthesizer
Bug:
Change-Id: Id1b5a80e10b8faba0f26d061e918d5f7f6f44224
M src/main/java/com/android/tools/r8/ir/desugar/CfPostProcessingDesugaringEventConsumer.java
M src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/apiconversion/DesugaredLibraryAPICallbackSynthesizer.java
M src/main/java/com/android/tools/r8/profile/art/rewriting/ArtProfileRewritingCfPostProcessingDesugaringEventConsumer.java
M src/main/java/com/android/tools/r8/shaking/Enqueuer.java
cl...@google.com <cl...@google.com> #22
Sorry there was an issue with the last hash triggering other bugs so I cannot backport it.
Can you check again with
pluginManagement {
buildscript {
repositories {
mavenCentral()
maven {
url = uri("https://storage.googleapis.com/r8-releases/raw/main")
}
}
dependencies {
classpath("com.android.tools:r8:9952fea15e2abee802e180706695bffb8dabed99")
}
}
}
?
I will try to backport this tomorrow if this works for you so that it's in the next eel point release (2).
ta...@gmail.com <ta...@gmail.com> #23
I have this error with the last version
Could not resolve all files for configuration 'classpath'.
> Could not find com.android.tools:r8:9952fea15e2abee802e180706695bffb8dabed99.
Searched in the following locations:
- https://repo.maven.apache.org/maven2/com/android/tools/r8/9952fea15e2abee802e180706695bffb8dabed99/r8-9952fea15e2abee802e180706695bffb8dabed99.pom
- https://storage.googleapis.com/r8-releases/raw/main/com/android/tools/r8/9952fea15e2abee802e180706695bffb8dabed99/r8-9952fea15e2abee802e180706695bffb8dabed99.pom
Required by:
unspecified:unspecified:unspecified
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
cl...@google.com <cl...@google.com> #24
Can you try again? It takes like 1 h to get it to upload to maven so maybe it was not there yet.
It would be nice to confirm it works because I have to land tomorrow if we want it in eel.
Else 9c1e702497c4bce7bddbf8e7bc5e10c8372ed4d6 was done afterwards.
ta...@gmail.com <ta...@gmail.com> #25
Yes, now 9952fea15e2abee802e180706695bffb8dabed99
works fine, the build is assembled and working properly.
Will it be in flamingo and giraffe?
cl...@google.com <cl...@google.com> #26
It will be in flamingo and giraffe though it takes weeks to reach the releases.
I am try to get in into eel but I'm not sure I will be able to.
R8 is part of agp though so it depends on agp updates not android studio (but recent android studio have more recent agp).
ta...@gmail.com <ta...@gmail.com> #27
Yes, of course, I understand that this is part of the agp. Perhaps this fix will be in the next release of r8?
ap...@google.com <ap...@google.com> #28
Branch: main
commit 1142fa00189d9d4829cbee87476281cbef6b86c8
Author: Clément Béra <clementbera@google.com>
Date: Wed Feb 08 09:28:09 2023
API callback fix for live non instantiated types
Bug:
Change-Id: I7d947f3e39a30b5da3e5bd307d3babb5fdb251f7
M src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/apiconversion/DesugaredLibraryAPICallbackSynthesizer.java
ap...@google.com <ap...@google.com> #29
Branch: 4.0
commit e70cabb270a305828df5e7e2ab4c7c299a70ea2e
Author: Clément Béra <clementbera@google.com>
Date: Wed Feb 08 10:51:54 2023
Version 4.0.52
Bug:
Change-Id: If7860604d6bc24173db1657b1ca8c397ba9e8732
M src/main/java/com/android/tools/r8/Version.java
ap...@google.com <ap...@google.com> #30
Branch: 4.0
commit 863b1f3f73452dae47130011c7de19cd8ef1813c
Author: Clément Béra <clementbera@google.com>
Date: Wed Feb 08 09:47:02 2023
Desugared library: don't generate callbacks for live non instantiated types
Bug:
Change-Id: I1497363ceab5842f7e09f7fc604c794a49b02ffb
M src/main/java/com/android/tools/r8/ir/conversion/IRConverter.java
M src/main/java/com/android/tools/r8/ir/desugar/CfPostProcessingDesugaringCollection.java
M src/main/java/com/android/tools/r8/ir/desugar/CfPostProcessingDesugaringEventConsumer.java
M src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/apiconversion/DesugaredLibraryAPICallbackSynthesizer.java
M src/main/java/com/android/tools/r8/shaking/Enqueuer.java
A src/test/java/com/android/tools/r8/desugar/desugaredlibrary/GuavaMultiSetSpliteratorTest.java
cl...@google.com <cl...@google.com>
ap...@google.com <ap...@google.com> #31
Branch: 8.0
commit 9e2261fb6d168056118d1d60cf0037b4c983f07c
Author: Clément Béra <clementbera@google.com>
Date: Wed Feb 08 11:12:27 2023
Version 8.0.28
- fix desugared lib api callback on dead methods
- fix desugared lib conversion with swap on wide operands
Bug:
Bug:
Change-Id: Id93395d8738be223d197b0332bf89491cbe1dc8c
M src/main/java/com/android/tools/r8/Version.java
ap...@google.com <ap...@google.com> #32
Branch: 8.0
commit b5242da0103a6406ca07ac632153b90b76a67d3e
Author: Clément Béra <clementbera@google.com>
Date: Wed Feb 08 10:57:58 2023
Desugared library: don't generate callbacks for live non instantiated types
Bug:
Change-Id: I1497363ceab5842f7e09f7fc604c794a49b02ffb
M src/main/java/com/android/tools/r8/ir/conversion/IRConverter.java
M src/main/java/com/android/tools/r8/ir/desugar/CfPostProcessingDesugaringCollection.java
M src/main/java/com/android/tools/r8/ir/desugar/CfPostProcessingDesugaringEventConsumer.java
M src/main/java/com/android/tools/r8/ir/desugar/desugaredlibrary/apiconversion/DesugaredLibraryAPICallbackSynthesizer.java
M src/main/java/com/android/tools/r8/shaking/Enqueuer.java
A src/test/java/com/android/tools/r8/desugar/desugaredlibrary/GuavaMultiSetSpliteratorTest.java
ch...@google.com <ch...@google.com>
dr...@gmail.com <dr...@gmail.com> #33
Still exists on:
R8 8.1.56
Gradle 8.2.0-alpha15
Android 2022.3.1
ch...@google.com <ch...@google.com> #34
The current issue was confirmed to be fixed in
If you would be able to share a zip dump of the compiler inputs (including the app's JVM class files, keep rules, etc.) we should be able to reproduce and fix the issue:
./gradlew assembleRelease --no-daemon -Dcom.android.tools.r8.dumpinputtodirectory=/path/to/dumps
You can share the dump privately with
See also
Description
I try to generate signed release build with next configs in my build.gradle.kts file:
getByName("release") {
isDebuggable = false
isShrinkResources = true
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
I used to successfully build a signed release build, but then I updated some of the dependencies and now it stopped building with the error message I provide below.
I updated quite a few libraries, including AGP and Compose compiler and much more, besides, there have been significant changes since then, so I don’t have the opportunity to roll back these changes in parts to understand whether the new dependencies are to blame or it’s not related at all with update
Maybe I'm using the wrong version of R8, or do I need to add some rules to proguard-rules.pro? I spent two days on this problem and I can't solve it in any way, any advice is welcome
P.S I tried clean, rebuild, invalidate Android Studio cache etc., it doesn't help :(
The error message that I receive again and again:
> Task :app:minifyReleaseWithR8 AGPBI:
{"kind":"error","text":"com.android.tools.r8.internal.e50: Attempt to enqueue an action in a non pushable
enqueuer work list.","sources":[{}],"tool":"R8"}
> Task :app:minifyReleaseWithR8 FAILED
com.android.tools.r8.internal.e50: Attempt to enqueue an action in a non pushable enqueuer work list.
StackTrace:
> Task :app:minifyReleaseWithR8
AGPBI: {"kind":"error","text":"com.android.tools.r8.internal.e50: Attempt to enqueue an action in a non pushable enqueuer work list.","sources":[{}],"tool":"R8"}
> Task :app:minifyReleaseWithR8 FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:minifyReleaseWithR8'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
> Compilation failed to complete
* Try:
> Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:minifyReleaseWithR8'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:142)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:282)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:140)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:128)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:77)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:57)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:69)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:322)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:309)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:302)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:288)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:462)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:379)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)
Caused by: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.tasks.R8Task$R8Runnable
at org.gradle.workers.internal.DefaultWorkerExecutor$WorkItemExecution.waitForCompletion(DefaultWorkerExecutor.java:348)
at org.gradle.internal.work.DefaultAsyncWorkTracker.lambda$waitForItemsAndGatherFailures$2(DefaultAsyncWorkTracker.java:130)
at org.gradle.internal.Factories$1.create(Factories.java:31)
at org.gradle.internal.work.DefaultWorkerLeaseService.withoutLocks(DefaultWorkerLeaseService.java:321)
at org.gradle.internal.work.DefaultWorkerLeaseService.withoutLocks(DefaultWorkerLeaseService.java:304)
at org.gradle.internal.work.DefaultWorkerLeaseService.withoutLock(DefaultWorkerLeaseService.java:309)
at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForItemsAndGatherFailures(DefaultAsyncWorkTracker.java:126)
at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForItemsAndGatherFailures(DefaultAsyncWorkTracker.java:92)
at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForAll(DefaultAsyncWorkTracker.java:78)
at org.gradle.internal.work.DefaultAsyncWorkTracker.waitForCompletion(DefaultAsyncWorkTracker.java:66)
at org.gradle.api.internal.tasks.execution.TaskExecution$3.run(TaskExecution.java:244)
at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBu