google / dagger

A fast dependency injector for Android and Java.
https://dagger.dev
Apache License 2.0
17.41k stars 2.01k forks source link

Records requires ASM8 #3113

Closed keluokeda closed 2 years ago

keluokeda commented 2 years ago

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

demo

AlexKrupa commented 2 years ago

I replied to you in the issue you filed against Moshi: https://github.com/square/moshi/issues/1463#issuecomment-994576201

Chang-Eric commented 2 years ago

Closing since this seems to be addressed in the linked issue and unrelated to Hilt.

FilippoVigani commented 2 years ago

@keluokeda did you manage to fix this?

HasanHaghniya commented 2 years ago

@FilippoVigani did you find a solution?

valeh962 commented 2 years ago

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