-
Notifications
You must be signed in to change notification settings - Fork 750
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Records requires ASM8 #1463
Comments
See this comment and linked issues: #1424 (comment) If you don't want to upgrade to AGP 7.2.0 (which isn't stable yet) and can't get rid of Jetifier, this Gradle property should help as a temporary workaround:
|
When I remove android.enableJetifier=true,it'll be ready in a jiffy |
|
From gradle plugin 7.x |
After disabling jetifier I still get the error. What am I missing?
|
Unfortunately, it seems Jetifier is not the only thing that triggers this issue. Other instrumentation plugins (like Firebase Performance) will fail the build with Moshi 1.13, and they don't all have a way to disable instrumentation for a given dependency. This is effectively preventing us from migrating to Kotlin 1.6 until AGP 7.2.0 is out, which could be in a long time. Would it be possible to fix the issue from Moshi's side? |
Firebase has a new release with a fix out already and jetifier has a workaround via exclusion list. We're not going to remove records support to "fix" bugs in other projects, let alone when they're not real issues anymore anyway. |
@ZacSweers Sorry about that, I checked for updates to firebase-perf but was looking at the wrong artifact. The 1.4.1 update doesn't seem to fix the issue for me, but for others who might be wondering, here's a better place to follow this issue: firebase/firebase-android-sdk#3155 |
Totally understandable position, I would say the same. Wondering would it be possible to create a version off 1.12 that fixed kotlin 1.6 support but didn't add the records support? I would guess it would be named 1.12.1 or something |
You should pursue this with firebase or build a jar locally with your specific needs. |
Yeah that's fair. I thought removing firebase performance plugin wasn't working (or the upgrade) but it turns out I had it added in two spots so this isn't as bad of a block and I just removed the plugin until they fix the issue. Thanks! |
Since this now doesn't look like it'll be fixed on the Firebase side, we've shaded moshi in our library until we're comfortable requiring users to be on AGP 7.2 Thought I'd post our abridged module build.gradle in case it's useful. This assumes that all moshi json classes, and retrofit interfaces etc are in this same module, but otherwise works in a multi-module setup, and with publishing
|
TBH this seems that this (Record support) has broken lot of usecases, especially because buggy stable AGP (update required by Kotlin 1.6) - broken with dagger, firebase performance, sentry performance, realm transformer, etc. The easiest way to fix it for us (cannot disable realm transformer) was creating custom Moshi build:
|
#3 doesn't make sense, there is no bytecode in the main Moshi jar outside of resources that contains record classes. |
Moshi.class contains a reference to RecordJsonAdapter. Not sure if purge is needed - the type does not exist anymore. |
Yes a reference to this one https://github.com/square/moshi/blob/master/moshi/src/main/java/com/squareup/moshi/RecordJsonAdapter.kt It's a class that is replaced with the actual records adapter automatically and gracefully no-ops everywhere else. This is how MR-Jars work. |
Hey all, I have tried everything switching between the solutions but nothing helped Wrong Solutions: Working Solution:
Since the firebase is having conflict with the Moshi release this breaks. reference -firebase/firebase-android-sdk#3155 |
Thanks ARIPRASATH4664, Your solution worked for me 👍 |
Hi, updating the Gradle plugin version to 7.2.2 worked! |
I get an error when use hilt and moshi
here is solution for demo but can not for my project
demo
The text was updated successfully, but these errors were encountered: