Status Update
Comments
ch...@google.com <ch...@google.com>
cl...@google.com <cl...@google.com> #2
ta...@gmail.com <ta...@gmail.com> #3
sg...@google.com <sg...@google.com> #4
cl...@google.com <cl...@google.com> #5
cl...@google.com <cl...@google.com> #6
Android Studio version: 0.8.12
buildToolsVersion 21.0.1
Gradle 1.11
ta...@gmail.com <ta...@gmail.com> #7
--set-max-idx-number=<value>
Unfortunately changing the default is not a solution since the linearAlloc limit can be reached at very different levels depending on the classes hierarchy and other criteria.
In addition for most applications, moving to multidex will only help to workaround the linearalloc limit for the installation. But the application will still crash against the same limit at execution. The only working use case where I know multidex can help with linearalloc is when the apk does not contains one application but distinct pieces running in separate process.
ta...@gmail.com <ta...@gmail.com> #8
It's nice to know about that command line option. I do not see it in the output of 'dx --help', might be good to add that.
I'm not very familiar with the 'linearAlloc limit' issue outside of the context of the dexopt step. My sample app is able to run once the lower idx value is set, although I do not actually call into any of the library code that is bundled with the app. I assume it's undefined when/if the 'linearAlloc limit' will be hit in a large application on gb.
I'm a bit confused as to the platform compatibility of multidex given the 'linearAlloc limit' bug. What specific versions of Android are supported? The multidex code implies back to v4 (
cl...@google.com <cl...@google.com> #9
The linearalloc limit is reached when loading classes. At install time dexopt is loading all classes contained in the dex so it's facing the limit immediately. At execution the limit may be reached after some delay dependending of the usage you have of the packaged classes. If you face it at install time but not at execution, this means you never trigger the loading of some classes. In a real application those never loaded classes should have been shrinked away manually or by Proguard. The exception is when there are different groups of classes in the dex files used in separate process.
About multidex library supported versions I've merged recently a change to try to be clearer
The summary is that the library should work down to API 4 (Donut), but below ICS applications will probably be hit by the linearalloc limit
ap...@google.com <ap...@google.com> #10
dexOptions {
additionalParameters = ['--multi-dex', '--set-max-idx-number=40000']
}
ta...@gmail.com <ta...@gmail.com> #11
cl...@google.com <cl...@google.com> #14
Issue: MarkMethodLiveAction java.util.Spliterator com.google.common.collect.Multiset.spliterator() from java.util.Spliterator com.google.common.collect.Multiset.spliterator()
Multiset.spliterator() should have been detected as a library override and be traced, but it isn't. So we then verify it is live later on, and it isn't.
There may be a way to reproduce the issue by creating a project using Multiset from guava.
cl...@google.com <cl...@google.com> #15
I found an issue and fixed it. It seems R8 is trying to generate call-backs for non live methods.
Once this lands I will ask you to check if it works for you (I don't have a hash yet).
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