Closed G00fY2 closed 3 years ago
I'm able to reproduce this as well in the sample app. Unfortunately I'm not sure how Coil would work around this in its code, however I was able to fix the issue by updating to R8 version 2.2.42 according to this comment and removing -allowaccessmodification
.
Thanks for you quick response and taking a look! We ended up switching to proguard-android.txt
instead of the proguard-android-optimize.txt
default rules as long as we support API19 (we will drop it with beginning of next year anyways). So for anyone else maybe facing this issue, this should do the job.
Hi,
thanks for this great library! So after some hours of debugging I finally came closer to the cause of crash reports we get in production after updating our app. We get
java.lang.VerifyError
exceptions which cause the app to crash at start. It's reproducible when updating Coil from 0.13.0 to 1.0.0 when using current AGP4.1.1 and R8 on API 19 devices only.I know that the log (see below) suggests that the issue is related to the workmanager, but I guess the app just crashes there because it gets initialized very early on app start. The issue is probably caused by the R8 shrinker. I already tried forcing the latest R8 shrinker (2.1.81, AGP4.1.1 uses 2.1.75 by default) but I had no success. I also tried compiling with Kotlin 1.4.0, 1.4.10 and 1.4.20. So it looks like the bug was under the radar so far.
I am willing to create a ticket on the Google issue tracker too. But I wanted to check what changed on the side of Coil before doing so.
Expected behavior Updating to Coil 1.0.0 should not cause crashes when using latest (stable) AGP and R8.
To Reproduce I can reproduce it locally by just switching between the two Coil versions and building with R8 enabled. If you need a minimal sample project I can try to help you out with that.
Logs/Screenshots
Version Happens on real Android 4.4 devices and with current API 19 emulator image.