EditSign (Forge&Fabric)

EditSign (Forge&Fabric)

820k Downloads

Failed to provide com.mojang:minecraft:1.16.1 : java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

mk-pmb opened this issue · 6 comments

commented

Describe the bug

I was probably missing some preparation step when trying to build tag EditSign-Fabric-1.16.1-2.0.0 (actions run).

I was looking for instructions how to build, but couldn't find them in that tag's README.*, and there were no files COMPIL*.* or BUILD*.*.

Minecraft version

1.16.1 (guessing from tag name)

Fabric API version

no idea

Mod version

2.0.0 (guessing from tag name)

Relevant log output

Fabric Loom: 0.4.33 Build(jenkins #33)
Compiling build file '/home/runner/work/ghabuild-minecraft-mod-editsign/ghabuild-minecraft-mod-editsign/mod-repo/build.gradle' using BuildScriptTransformer.
:setting up loom dependencies
Java plugin detected, adding integration...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'mod-repo'.
> Failed to provide com.mojang:minecraft:1.16.1 : java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $

* Try:
Run with --debug option to get more log output. Run with --scan to get full insights.

* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'mod-repo'.
[…]
Caused by: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was STRING at line 1 column 1 path $
    at com.google.gson.stream.JsonReader.beginObject(JsonReader.java:385)
    at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$Adapter.read(ReflectiveTypeAdapterFactory.java:215)
    ... 147 more
commented

I'm not too sure as it seems to be loom related. But as this version is old and things changed since then, you may need to update loom to 1.1-SNAPSHOT for it to work. Though that requires newer java versions to build and upgrade the Gradle version.
But I'm not sure at all on this, just I had a similar issue on another mod where I needed to update loom for it to build (it gave me a download error because it used a not supported HTTP url instead of HTTPS).

commented

For FallingTree I had to fix some as I did some fixes recently. Fron like 1.16 up to recent versions, so you can get inspiration from the recent PRs, but in the end it's mostly the same thing from the PR I linked.

commented

Though that requires newer java versions to build and upgrade the Gradle version.

So I ran it with Java 17 and tried to upgrade gradle:

@@ gradle/wrapper/gradle-wrapper.properties
-distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

So does it just ignore the version number in the URL?
Or is this just a warning that it will fail if I were to upgrade gradle even further?

Also I upgraded loom:

@@ build.gradle
-    id 'fabric-loom' version '0.4-SNAPSHOT'
+    id 'fabric-loom' version '1.1-SNAPSHOT'

Now I get

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':processResources'.
> Entry fabric.mod.json is a duplicate but no duplicate handling strategy has been set. Please refer to https://docs.gradle.org/7.6/dsl/org.gradle.api.tasks.Copy.html#org.gradle.api.tasks.Copy:duplicatesStrategy for details.
commented

Look at the PR I linked, everything that isn't a Java file should be updated.

This includes the "duplicateStrategy".

image

Sorry to not be able to help you much more, I'm on a trip and doesn't have much access to a computer 😊

commented

Oh ok, I'll have a closer look then. Also I figured out the version 8 probably comes from the workflow file. Thanks for your help!

I hope I don't distract you from your trip too much. Fixing those old versions is low priority for me, I could even live with giving up on them. So no worries!

commented

Thank you again for your hints! Unfortunately I have to abandon fixing the old versions for lack of time.