Skip to content
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

Gson Error when Reloading Project (1.20.4 Loom 1.5.2) #1020

Closed
thomasglasser opened this issue Jan 6, 2024 · 11 comments
Closed

Gson Error when Reloading Project (1.20.4 Loom 1.5.2) #1020

thomasglasser opened this issue Jan 6, 2024 · 11 comments

Comments

@thomasglasser
Copy link

When refreshing my project recently, it fails with this log:
https://paste.gg/p/anonymous/45026e85e656461fbfd6f09ef27127bf
This started happening seemingly out of the blue and I've deleted and refreshed and cleared caches but I can't find the cause

@modmuss50
Copy link
Member

Do you have any other Gradle plugins? It seems to be using GSON 2.9.1, but loom depends on 2.10.1. Running with --info might provide some details on where this is coming from.

@thomasglasser
Copy link
Author

This is what --info says about gson
(com.google.gson.Gson) with version (null) was loaded from (/C:/Users/tjgla/.gradle/caches/modules-2/files-2.1/com.google.code.gson/gson/2.9.1/2cc2131b98ebfb04e2b2c7dfb84431f4045096b/gson-2.9.1.jar)

@modmuss50
Copy link
Member

Is this a project with multiple sub projects? I have a feeling this is the age old issue of Gradle not pulling in the correct versions of libraries.

If so all your plugin versions must be defined in the root build.gradle file with apply false

See: https://docs.gradle.org/current/userguide/plugins.html#sec:subprojects_plugins_dsl and https://github.com/FabricMC/fabric-loader/blob/master/build.gradle#L15

@thomasglasser
Copy link
Author

Doesnt have any subprojects. I tried putting id 'gson' version '2.10.+' apply false but it can't find it

@thomasglasser
Copy link
Author

Downgrading to 1.4.6 fixes it so it's a 1.5 or above change

@jpenilla
Copy link
Contributor

jpenilla commented Jan 6, 2024

May be related to gradle/foojay-toolchains#52

@modmuss50
Copy link
Member

May be related to gradle/foojay-toolchains#52

Yes, quite possibly. @thomasglasser can you provide a project where this doesnt work. I dont think you mentioned if you had any other Gradle plugins or not?

@zml2008
Copy link
Contributor

zml2008 commented Jan 6, 2024

I'm running into the same issue as well in KyoriPowered/adventure-platform-fabric#125 -- jmp has a workaround in his foojay PR, I ended up doing this as an alternate workaround. Hopefully our Gradle friends will be able to put out a release soon to resolve this issue for now? The whole classloader hierarchy thing is very unfortunate.

@modmuss50
Copy link
Member

Im going to close this as I dont think there is anything I can do to help with this, im also not going to let it block the 1.5 stable release.

@modmuss50 modmuss50 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 7, 2024
TheMrMilchmann added a commit to TheMrMilchmann/gradle-curseforge-publish that referenced this issue Jan 10, 2024
@thomasglasser
Copy link
Author

I think this may be caused by having deps that don't use loom 1.5

@thomasglasser
Copy link
Author

thomasglasser commented Jan 20, 2024

Because my project with no deps works fine. The workaround seems to have fixed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants