Thanks to visit codestin.com
Credit goes to github.com

Skip to content

sqldelight gradle plugin breaks usage of kotlinx.coroutines #4650

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

Closed
staktrace opened this issue Sep 22, 2023 · 2 comments
Closed

sqldelight gradle plugin breaks usage of kotlinx.coroutines #4650

staktrace opened this issue Sep 22, 2023 · 2 comments

Comments

@staktrace
Copy link

SQLDelight Version

1.5.4

Operating System

macOS

Gradle Version

7.6.1

Kotlin Version

1.9.10

Dialect

n/a

AGP Version

No response

Describe the Bug

Adding the sqldelight gradle plugin (com.squareup.sqldelight:gradle-plugin:1.5.5) to my build classpath causes this exception in another gradle plugin:

Caused by: java.lang.NoSuchMethodError: kotlinx.coroutines.JobNode: method 'void <init>()' not found
at kotlinx.coroutines.AwaitAll$AwaitAllNode.<init>(Await.kt:103)
at kotlinx.coroutines.AwaitAll.await(Await.kt:77)
at kotlinx.coroutines.AwaitKt.awaitAll(Await.kt:42)
... proprietary code here ...

It appears that the sqldelight gradle plugin is a shadowJar, and includes the kotlinx.coroutines.JobNode class inside the jar - however it includes an older version of the JobNode class that doesn't have the no-arg constructor (which was added in this commit).

The sqldelight gradle plugin looks like it's explicitly omitting shading stuff that starts with kotlin here (at least based on my skimming that build script), but I think it probably should be shading the kotlinx stuff too.

Note that this appears to be a long-standing problem, because while searching for the error I ran across another bug report at gradle/gradle#18554 that contains a reproducible test cases with a slightly older version of sqldelight.

Stacktrace

No response

Gradle Build Script

No response

@staktrace staktrace added the bug label Sep 22, 2023
staktrace added a commit to staktrace/sqldelight that referenced this issue Sep 22, 2023
Leaving the kotlinx.coroutines classes unshaded in the plugin means
they can interfere with other plugins that are relying on that code
at a different version.

Fixes sqldelight#4650
staktrace added a commit to staktrace/sqldelight that referenced this issue Sep 22, 2023
Leaving the kotlinx.coroutines classes unshaded in the plugin means
they can interfere with other plugins that are relying on that code
at a different version.

Fixes sqldelight#4650
@hfhbd
Copy link
Collaborator

hfhbd commented Sep 23, 2023

This is fixed in 2.0 by #4079.

Afaik we don't want to support/release an 1.5.6 version, do we @AlecKazakova?

@staktrace
Copy link
Author

Discussed this @AlecKazakova , and we're not going to release a 1.5.6. I'll upgrade consumers to 2.0 instead.

@JakeWharton JakeWharton removed the bug label Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants