resaca icon indicating copy to clipboard operation
resaca copied to clipboard

Cannot inline bytecode built with JVM target 17

Open brsuslcn opened this issue 1 year ago • 5 comments

I use this library in my projects, especially when I use ViewModel in ModalBottomSheets and composables that don't have navigation. For one of my projects, I cannot use it because I get a javaTarget error. I have already set the javaTarget to 17, and I have tried invalidating caches and cleaning the project, but none of them worked. I am using Hilt version 2.51.1 and Resaca-Hilt version 4.1.3.

Java Target: ss2

The error: ss1

brsuslcn avatar Sep 03 '24 11:09 brsuslcn

Maybe it's related to kotlinOptions being deprecated and replaced with compilerOptions 🤔

Have you tried using the new Kotlin API for this? https://stackoverflow.com/a/77903418/5250468 That's the API I also use in the resaca codebase https://github.com/sebaslogen/resaca/blob/7b089923036c0e517ffb0e979a4e6679dbc8d03a/build.gradle.kts#L48

sebaslogen avatar Sep 03 '24 13:09 sebaslogen

Maybe it's related to kotlinOptions being deprecated and replaced with compilerOptions 🤔

Have you tried using the new Kotlin API for this? https://stackoverflow.com/a/77903418/5250468 That's the API I also use in the resaca codebase

https://github.com/sebaslogen/resaca/blob/7b089923036c0e517ffb0e979a4e6679dbc8d03a/build.gradle.kts#L48

I applied everything, but none of them are working. This dependency cannot correctly identify if the Java version is 17; it always detects it as Java version 1.8

brsuslcn avatar Sep 03 '24 13:09 brsuslcn

Maybe it's related to kotlinOptions being deprecated and replaced with compilerOptions 🤔 Have you tried using the new Kotlin API for this? https://stackoverflow.com/a/77903418/5250468 That's the API I also use in the resaca codebase https://github.com/sebaslogen/resaca/blob/7b089923036c0e517ffb0e979a4e6679dbc8d03a/build.gradle.kts#L48

I applied everything, but none of them are working. This dependency cannot correctly identify if the Java version is 17; it always detects it as Java version 1.8

Then I'm out of ideas, maybe if you share your code I can take a look, but if you say other projects work for you, I assume the problem is somewhere in that specific project's configuration.

sebaslogen avatar Sep 03 '24 14:09 sebaslogen

Ah, one more thing, the JDK that compiles your project has to be 17 or newer, you can check just in case with java --version

sebaslogen avatar Sep 03 '24 14:09 sebaslogen

Yeah, I know, I'm using the latest Java version. It works for other projects, but not for one of them. I think it's related to KSP or Kotlin DSL. I'll also try downgrading the AGP version

brsuslcn avatar Sep 03 '24 14:09 brsuslcn

Since there were no updates on this issue in a while for your specific project, I'm closing this for now. If you have any new info or updates, please feel free to reopen.

sebaslogen avatar Oct 31 '24 18:10 sebaslogen