Status Update
Comments
ch...@google.com <ch...@google.com>
cl...@google.com <cl...@google.com> #2
Okay. I tried a bunch of agp+android studio versions
The last working version was classpath("com.android.tools.build:gradle:7.4.0-alpha06")
once I moved to
classpath("com.android.tools.build:gradle:7.4.0-alpha07")
then things start breaking on firebase app dist.
ta...@gmail.com <ta...@gmail.com> #3
Scott, assigning to you as it seem to complain the zip is not aligned while packaging which is very puzzling considering the steps...
sg...@google.com <sg...@google.com> #4
OP, when you build the APK with AGP, are you doing any post-processing on the APK and/or do you have any custom tasks that are modifying the APK?
Can you try to verify the alignment of your APK with zipalign
locally (zipalign
is included in build-tools
):
zipalign -c -v 4 foo.apk
cl...@google.com <cl...@google.com> #5
Not doing any post processing. No custom tasks. I will try to verify alignment now. Give me a sec.
cl...@google.com <cl...@google.com> #6
Scenario 1:
built my apk with agp alpha09, but didn't update firebase (bom = 30.2.0)
/Users/idle/Library/Android/sdk/build-tools/31.0.0/zipalign -c -v 4 app-release.apk
"Verification succesful"
Scenario 2:
built my apk with agp alpha09, but I DID update firebase (bom = 30.3.1)
/Users/idle/Library/Android/sdk/build-tools/31.0.0/zipalign -c -v 4 app-release.apk
"Verification FAILED"
ta...@gmail.com <ta...@gmail.com> #7
Scenario 3:
built my apk with agp alpha09, with androidx.splash rc01
/Users/idle/Library/Android/sdk/build-tools/31.0.0/zipalign -c -v 4 app-release.apk
"Verification succesful"
Scenario 4:
built my apk with agp alpha09, with androidx.splash 1.0.0
/Users/idle/Library/Android/sdk/build-tools/31.0.0/zipalign -c -v 4 app-release.apk
"Verification FAILED"
In both failed cases if I do | grep BAD
I get
7216334 junit/runner/logo.gif (BAD - 2)
7217354 junit/runner/smalllogo.gif (BAD - 2)
ta...@gmail.com <ta...@gmail.com> #8
In the cases where zipalign
verification fails, is the APK generated by a clean build (e.g., ./gradlew clean :app:assembleRelease
)?
Does verification succeed if you add this to your build.gradle?
android {
packagingOptions {
exclude 'junit/runner/logo.gif'
exclude 'junit/runner/smalllogo.gif'
}
}
cl...@google.com <cl...@google.com> #9
In the cases where zipalign verification fails, is the APK generated by a clean build (e.g., ./gradlew clean :app:assembleRelease)?
I clean before i generate the apk using the Android Studio menu for generating an apk
Does verification succeed if you add this to your build.gradle?
I assume it will, but let me try. Any reason why changing from androidx.splash 1.0.0-rc01 to 1.0.0 stable (which is 0 changes. all it changed was the dependency version) that it fails verification. It seems like something else is wrong that's a bit deeper than just adding these two exclude statements.
ap...@google.com <ap...@google.com> #10
It seems like something else is wrong that's a bit deeper than just adding these two exclude statements.
I agree, but I'd like to find a workaround for you in the meantime.
I think I'll probably need a repro project to get to the bottom of it. In your other thread, it sounded like you weren't able to create a repro project... any luck since then?
ta...@gmail.com <ta...@gmail.com> #11
cl...@google.com <cl...@google.com> #12
Thanks!
ta...@gmail.com <ta...@gmail.com> #13
not able to get a repro case. literally any minor thing i change makes this verify successfully. im a bit out of ideas. the only thing i can think of that might help is why is junit being packaged into my app.
and i think the reason for that is that I depend on okhttp3:mockwebserver:4.10.0
implementation("junit:junit:4.13.2") // Needed because mockwebserver has a dependency on it. This can be removed in okhttp 5+
so the apps i ship through firebase have a mockwebserver using okhttpmockwebserver, but version 4+ requires junit while okhttp 5+ (not yet released), removes this dep.
so maybe just playing around with adding junit as a dependency to an actual app might help repro?
source:
maybe still owrth checking out as there could be other deps that end up with the same issue. idk. just trying to be helpful i guess. but as for me. im going to consider this case closed. excluding the above like you mentioned has unblocked my team. cheers
cl...@google.com <cl...@google.com> #14
Thanks for looking into it!
I agree it's strange they have an implementation
dependency on junit, and I'm glad they're removing it in okhttp 5+.
I'll go ahead and close this bug for now.
cl...@google.com <cl...@google.com> #15
This is fixed by Change-Id: I12ec8785cd4dbb6e523c66b4620ed2388f448822, which will be in AGP 7.4.0-rc01 and 8.0.0-alpha08.
ap...@google.com <ap...@google.com> #16
Thanks for filing the bug, OP. Your observation in
cl...@google.com <cl...@google.com> #17
FUCK YEAH! Glad I was helpful! Appreciate you working through it with me here. Cheers. Once I update to alpha08 I will remove the workaround I added. cheers
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