Status Update
Comments
ch...@google.com <ch...@google.com> #2
AGP 8.8 ships with R8 8.8. If you are using R8 8.3.37 you must explicitly be downgrading R8 several versions. Can you try using the R8 8.8 that ships with AGP 8.8.2?
See also
ma...@gmail.com <ma...@gmail.com> #3
I cleared my cache and the entire project, and I directly pointed to version 8.8 in the build.gradle (check attachment), but still the version being used is:
Current version is: 8.3.37 (build 3ccc501316db4344828180e7152a4adb97522bf8 from go/r8bot (luci-r8-custom-ci-focal-17-2jq9)).
I also tried not to define the version of R8, but the same build version is always used.
sg...@google.com <sg...@google.com> #4
Please take a look at pluginManagement
).
ch...@google.com <ch...@google.com> #5
Closing this as WAI since this is due to using an old version of R8 that does not support kotlinx-metadata-jvm 2.1.0. If you are still unable to find the cause of the version downgrade then please let us know.
ma...@gmail.com <ma...@gmail.com> #6
Hi team,
Quick update - the issue is now resolved after I manually forced the correct R8 version.
Thank you! Mateusz
sg...@google.com <sg...@google.com> #7
Thank you for reporting back. However, if you have to force the R8 version when using AGP 8.8 it looks as if there is some issue hiding in your setup.
Description
When building a Flutter app for release using R8, the build fails with the following exception:
ERROR: R8: java.lang.IllegalArgumentException: Provided Metadata instance has version 2.1.0, while maximum supported version is 2.0.0. To support newer versions, update the kotlinx-metadata-jvm library.
As a workaround, I was forced to disable options: minifyEnabled and shrinkResources which increases app size and reduces performance — clearly not ideal.
Steps to reproduce:
flutter build appbundle --flavor flav --dart-define=FLAVOR=flav --target=lib/main.dart -v
My environment:
Let me know if you need any additional info.
Mateusz