Status Update
Comments
ey...@gmail.com <ey...@gmail.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.
ri...@google.com <ri...@google.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...
ey...@gmail.com <ey...@gmail.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
ri...@google.com <ri...@google.com> #5
Not doing any post processing. No custom tasks. I will try to verify alignment now. Give me a sec.
ey...@gmail.com <ey...@gmail.com> #6 Restricted
ey...@gmail.com <ey...@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)
ri...@google.com <ri...@google.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'
}
}
ey...@gmail.com <ey...@gmail.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.
ri...@google.com <ri...@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?
ey...@gmail.com <ey...@gmail.com> #11
I was not able to create a repro unfortunately. As soon as I started to prune things out of my project it started to succeed.
Similarly. firebase came out with a new version. and if i use that new version... then it also succeeds. 🤯
I'm glad to hear there is a workaround for now (and i learned something new about zipalign). I will try to create a repo project again later today when I have about an hour or so free to play around with it, but for now I will just commit the
android {
packagingOptions {
exclude 'junit/runner/logo.gif'
exclude 'junit/runner/smalllogo.gif'
}
}
to my codebase because that did the trick for me. Everything works. Thank you for your quick response and helpful debugging steps.
ri...@google.com <ri...@google.com> #12
Thanks!
ey...@gmail.com <ey...@gmail.com> #13 Restricted
ri...@google.com <ri...@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.
ap...@google.com <ap...@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
ap...@google.com <ap...@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: 8.1
commit 5b05fb6ade7fe062b259cd4d814016e3eb38e1b8
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Apr 19 14:15:30 2023
Ensure redundant array get elimination leads to narrowing
Bug:
Change-Id: I5f4fd4f491ddac40d4e720862ab711220c0be145
M src/main/java/com/android/tools/r8/ir/optimize/RedundantFieldLoadAndStoreElimination.java
M src/test/java/com/android/tools/r8/ir/optimize/redundantarraygetelimination/ArrayGetTypePromotionTest.java
ap...@google.com <ap...@google.com> #19
Branch: 8.1
commit 5ebb25ada2139cd2f74383d938f43a4640682b3e
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Apr 19 14:15:02 2023
Reproduce VerifyError after redundant array get elimination
Bug:
Change-Id: Ia2c62ad8f7a4c5f2d9333a6514a71f7d8db8720c
A src/test/java/com/android/tools/r8/ir/optimize/redundantarraygetelimination/ArrayGetTypePromotionTest.java
ap...@google.com <ap...@google.com> #20
Branch: 8.0
commit 1232278046bfec8d70bf4d0ff9891c732855bed1
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Apr 19 14:28:29 2023
Version 8.0.41
Bug:
Change-Id: I36de3c467318a872f9b52e6c1665a03cda894015
M src/main/java/com/android/tools/r8/Version.java
ap...@google.com <ap...@google.com> #21
Branch: 8.0
commit aa653f09ec2c293dfb1441c41ee3b23c14edbc14
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Apr 19 14:27:02 2023
Ensure redundant array get elimination leads to narrowing
Bug:
Change-Id: I5f4fd4f491ddac40d4e720862ab711220c0be145
M src/main/java/com/android/tools/r8/ir/optimize/RedundantFieldLoadAndStoreElimination.java
M src/test/java/com/android/tools/r8/ir/optimize/redundantarraygetelimination/ArrayGetTypePromotionTest.java
ap...@google.com <ap...@google.com> #22
Branch: 8.0
commit 3c78b472e17ff4df1a4cbe7f779963f4551ceac7
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Apr 19 14:26:09 2023
Reproduce VerifyError after redundant array get elimination
Bug:
Change-Id: Ia2c62ad8f7a4c5f2d9333a6514a71f7d8db8720c
A src/test/java/com/android/tools/r8/ir/optimize/redundantarraygetelimination/ArrayGetTypePromotionTest.java
ap...@google.com <ap...@google.com> #23
Branch: 4.0
commit 6847d39873c892ae31dd0a0051ede9c029a73e53
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Apr 19 14:29:51 2023
Version 4.0.60
Bug:
Change-Id: I5c3e809529a800a2bd0cf393f12fafb86b9d27c1
M src/main/java/com/android/tools/r8/Version.java
ap...@google.com <ap...@google.com> #24
Branch: 4.0
commit 44f109564ca44b7457b0426ace67db36a5fbea3a
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Apr 19 14:26:59 2023
Ensure redundant array get elimination leads to narrowing
Bug:
Change-Id: I5f4fd4f491ddac40d4e720862ab711220c0be145
M src/main/java/com/android/tools/r8/ir/optimize/RedundantFieldLoadAndStoreElimination.java
M src/test/java/com/android/tools/r8/ir/optimize/redundantarraygetelimination/ArrayGetTypePromotionTest.java
ap...@google.com <ap...@google.com> #25
Branch: 4.0
commit 5b029e66087245d269c4c484e553142b9d7dbb22
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Apr 19 14:26:11 2023
Reproduce VerifyError after redundant array get elimination
Bug:
Change-Id: Ia2c62ad8f7a4c5f2d9333a6514a71f7d8db8720c
A src/test/java/com/android/tools/r8/ir/optimize/redundantarraygetelimination/ArrayGetTypePromotionTest.java
ap...@google.com <ap...@google.com> #26
Branch: 8.0
commit aa653f09ec2c293dfb1441c41ee3b23c14edbc14
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Apr 19 14:27:02 2023
Ensure redundant array get elimination leads to narrowing
Bug:
Change-Id: I5f4fd4f491ddac40d4e720862ab711220c0be145
M src/main/java/com/android/tools/r8/ir/optimize/RedundantFieldLoadAndStoreElimination.java
M src/test/java/com/android/tools/r8/ir/optimize/redundantarraygetelimination/ArrayGetTypePromotionTest.java
ap...@google.com <ap...@google.com> #27
Branch: 8.0
commit 3c78b472e17ff4df1a4cbe7f779963f4551ceac7
Author: Christoffer Quist Adamsen <christofferqa@google.com>
Date: Wed Apr 19 14:26:09 2023
Reproduce VerifyError after redundant array get elimination
Bug:
Change-Id: Ia2c62ad8f7a4c5f2d9333a6514a71f7d8db8720c
A src/test/java/com/android/tools/r8/ir/optimize/redundantarraygetelimination/ArrayGetTypePromotionTest.java
ch...@google.com <ch...@google.com> #28
This should be fixed in R8 4.0, 8.0, 8.1, and 8.2 now. It would be great if you could confirm if 8.1.39 works for you. Thanks.
ey...@gmail.com <ey...@gmail.com> #29
I tested with 8.1.39 and it looks like it is fixed, thank you!
Any idea of what version of AGP this will ship with?
ch...@google.com <ch...@google.com> #30
Good to hear! This should land in AGP 8.1 beta 2.
Description
After updating Kotlin to 1.8.20 my app crashes in release mode with R8 enabled:
From the mapping, it appears that
rm3
isandroidx.profileinstaller.ProfileInstallerInitializer$Choreographer16Impl
We're using AGP 8.1.0-alpha11