Build Failed with an exception (could not get fastutil)

I apologize dearly if this isn’t the right place for this. I was trying to work with MCreator but I’ve been getting this error and they can’t seem to help with it so I decided to post here. Here’s the error:

Executing Gradle task: eclipse
Build info: MCreator 2023.3.36712, forge-1.19.2, 64-bit, 32648 MB, Windows 10, JVM 17.0.7, JAVA_HOME: E:\MCreator\jdk, started on: 2023-11-29-16:15:55
 
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'SleekDeco'.
> Could not resolve all files for configuration ':classpath'.
 > Could not download fastutil-8.3.1.jar (it.unimi.dsi:fastutil:8.3.1)
  > Could not get resource 'https://maven.minecraftforge.net/it/unimi/dsi/fastutil/8.3.1/fastutil-8.3.1.jar'.
  > Premature end of Content-Length delimited message body (expected: 19,011,744; received: 5,214,680)
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 6m 1s
Task completed in 6 minutes and 5 seconds

I tried downloading the fastutil 8.3.1 manually and placed it in the ‘lib’ folder but even that doesn’t seem to be working. Any suggestions on what I should do or ask for help at?

Well, Gradle tries to download that file which is 19 MiB in size, but after almost 5 MiB the download ends.
I’d tend to blame some Firewall, Proxy, or Anti-Virus to abort the download for some reason.
There is nothing Gradle could do to fix this.
Is the manually downloaded file 19 MiB, or also just around 5 MiB?
If I download the file it has the expected 19 MiB.

Yes, it’s around 18 MiB. My anti-viruses are disabled. I tried downloading the file myself and despite being a very slow download than usual, it does finish. So do you have any suggestion as to what I can do to fix this? Or does this have something to do with my ISP - is it something I can fix through my router settings?

I have no idea at all unfortunately.
As you and me can properly download the file from the server manually, it is most probably not a problem on that server.
I also tried to let Gradle download the lib in a trivial build and it also worked just fine.

So yes, the problem seems to be somewhere between your Gradle execution and the respository.
Whether this is something your ISP does, or some program on your computer, or some proxy you use, or whatever else, I can just wildly speculate.

Actually I just checked again, seems like the download does not finish. I downloaded the same file from another site and that worked. So that’s probably the issue; don’t know how to fix it.

Also, is there no way to manually download the files and put it in the designated directories? I tried downloading and putting the fastutil jar in the ‘lib’ folder but that doesn’t seem to be doing anything.

You could download the file, put it to some local directory (not the target where you think it will end up) and declare a flatDir repository pointing to that local directory that is above the Minecraftforge repository. Then this flatDir repository is checked first and as the file is found the remote repository will not be queried.

But I really recommend you try to find out what is disturbing the download instead. :slight_smile: