question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Records requires ASM8

See original GitHub issue

I get an error when use hilt and moshi


1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugDuplicateClasses'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
   > Failed to transform moshi-1.13.0.jar (com.squareup.moshi:moshi:1.13.0) to match attributes {artifactType=enumerated-runtime-classes, org.gradle.category=library, org.gradle.dependency.bundling=external, org.gradle.jvm.environment=standard-jvm, org.gradle.jvm.version=8, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime, org.jetbrains.kotlin.platform.type=jvm}.
      > Execution failed for JetifyTransform: /Users/yuyanhui/.gradle/caches/modules-2/files-2.1/com.squareup.moshi/moshi/1.13.0/da685586facab9eb5c4fb630ce248be14e7da21b/moshi-1.13.0.jar.
         > Failed to transform '/Users/yuyanhui/.gradle/caches/modules-2/files-2.1/com.squareup.moshi/moshi/1.13.0/da685586facab9eb5c4fb630ce248be14e7da21b/moshi-1.13.0.jar' using Jetifier. Reason: UnsupportedOperationException, message: Records requires ASM8. (Run with --stacktrace for more details.)
           Suggestions:
            - Check out existing issues at https://issuetracker.google.com/issues?q=componentid:460323&s=modified_time:desc, it's possible that this issue has already been filed there.
            - If this issue has not been filed, please report it at https://issuetracker.google.com/issues/new?component=460323 (run with --stacktrace and provide a stack trace if possible).

* Try:
Run with --stacktrace option to get the stack trace. Run with --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

here is solution for demo but can not for my project

  • remove classpath “com.google.dagger:hilt-android-gradle-plugin:$hilt_version”
  • or remove implementation “com.squareup.moshi:moshi-kotlin:$moshi_version” and kapt “com.squareup.moshi:moshi-kotlin-codegen:$moshi_version”
  • or remove android.enableJetifier=true

demo

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
valeh962commented, Jan 26, 2022

@FilippoVigani @SecretKeeper put this line to gradle.properties : android.jetifier.ignorelist=moshi-1.13.0

0reactions
SecretKeepercommented, Jan 21, 2022

@FilippoVigani did you find a solution?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Records requires ASM8 - java - Stack Overflow
I want to play around with the newest Java 15 with preview features. I'm using Spring Boot 2.4.0-M2 and Gradle 6.7-rc2, where both...
Read more >
Attempt to build JVM record with JPS fails with UOE
Attempt to build JVM record with JPS fails with UOE: "Record requires ASM8" at ClassVisitor.visitRecordComponent() ; Project, Kotlin IntelliJ IDEA plugin.
Read more >
Spotbugs plugin, ASM8, and Java 14 - Gradle Forums
UnsupportedOperationException: Records requires ASM8 . We're using the latest SpotBugs plugin ( id "com.github.spotbugs" version "4.3.0" ) which ...
Read more >
Descriptor generation fails if a Mojo uses Java Records ...
If a Mojo uses Java Records, then plugin's descriptor generation fails with the following error: "descriptor failed: Record requires ASM8" ...
Read more >
ASM used by Android Gradle plugin/Jetifier doesn't support ...
(Won't work if the library does require refactoring to support AndroidX via ... Note that Jetifier 1.0.0-beta10 still uses ASM 8, so if...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found