Jump to content

Should I downgrade back to ForgeGradle 3.+?

Lemon Lord

Recommended Posts

Hey lovely forge people, I have a gradle problem. Essentially I updated to gradle 6.8.1 so that I could use ForgeGradle 4.1.+ and now I can no longer build my project (edit: I should specify that I mean I can no longer execute `gradlew build` with any success, running the client works fine. I want to be able to do this so I can get the .jar for my mod). I do have spongeforge mixins. The error I'm getting is `Execution failed for task ':addRefMapToJar'.` I assume this is stemming from the line in my build.gradle that goes:

mixin {
    add sourceSets.main, 'mixins.aome.refmap.json'

which is likely something to do with spongeforge and not with forge itself. I've taken a look at some other popular 1.16.5 mod source code that use spongeforge mixins and have noticed that all of them still use ForgeGradle 3.+.

My question is as the title presents it but also is there any benefit of upgrading the forge gradle version? Builds worked back on Gradle 4.9 (I think it was 4.9, I can't be sure) so I assume spongeforge just hasn't been updated since. Also how do I downgrade back to 3.+? I cannot reload my gradle in IntelliJ because:

A problem occurred evaluating root project 'AppleOfMyEye'.
> Failed to apply plugin 'net.minecraftforge.gradle'.
   > Found Gradle version Gradle 6.8.1. Versions Gradle 6.0.0 and newer are not supported in FG3, FG4 however supports Versions 6.8.1 and newer. Consider upgrading.

and I can't change my gradle version with the wrapper using `gradlew wrapper --gradle-version 4.9` as it prints the same as the above.

Really lost. The only reason I'm doing this is so I can test if player skins are loading properly and I can't do that with my current dev kit because it always launches in offline mode (i.e. Invalid Session) on a fake account called 'Dev'... so I'm building the mod jar to test in a proper forge client rather than in the MDK.

Anyway, thanks for reading all that, I appreciate any help with any of the many branching questions there.

Edited by Lemon Lord
Link to comment
Share on other sites

Update: after running `gradlew clean` I was able to run the wrapper change and then building worked but still confused as to why I had to downgrade, maybe I should've posted this topic in ForgeGradle. Would also like to know if it's possible to generate valid session tokens with the Mod Development Kit so I can test online functionality such as my changes to skin downloading for heads.

Link to comment
Share on other sites

Spiffing! Thank you, read somewhere in some old 1.7.10 cookbook it was '--pass' and when that didn't work I gave up trying. Do you know why player heads still aren't working? I can see my own head but all other heads seem to pause the game to download the texture but then just render as Alex. Is there something additional I need to add to the run configuration to make it connect to api.minecraft.net or is that outside of the reach of forge to begin with?


You have to post the actual error you receive with FG4.

I'm sorry, I don't remember. I downgraded to 3.+ and can't remember how to upgrade back to 4.1.+ though I do know it would take a lot of time to redownload, that happens whenever I reload my gradle and the constant impotent waiting is slowly killing me. The only bit that seemed relevant was `Execution failed for task ':addRefMapToJar'` though between that and the contents of the above coe block beginning with "A problem occurred evaluating root project 'AppleOfMyEye'." I don't think there was anything else in the big red error text. My IntelliJ was also highlighting the 'add' command(? method? function?) in my build.gradle (see the code block from the original post) and saying it didn't exist in the org.gradle.api which I think indicates it wasn't applying the spongeforge mixin plugin correctly as 'add' is a spongeforge method. That or IntelliJ was able to pick it up on Gradle 4.9 and not on Gradle 6.8.1... somehow. I can only assume this is a result of MixinGradle not being properly supported for Gradle 6 though I do not understand Gradle in the slightest.

Edited by Lemon Lord
Link to comment
Share on other sites

My mistake the player head thing seems to be a problem with vanilla. Doesn't seem you can just enter a player name and have it get the player anymore, you require the full serialised GameProfile. Works though, so that's good news.


A couple days ago I upgraded a project of mine to FG 4 and it worked fine (with MixinGradle).

Can you link me your project's repo? I'd like to see if I'm doing something wrong. If it's private or local-only, obviously don't worry.

Link to comment
Share on other sites

Alright I went back to 4.1.+ because some stuff wasn't working, here's the entire output for the failed build.

To honour the JVM settings for this build a single-use Daemon process will be forked. See https://docs.gradle.org/6.8.1/userguide/gradle_daemon.html#sec:disabling_the_daemon.
Daemon will be stopped at the end of the build

> Configure project :
[MixinGradle] Skipping eclipse integration, extension not found
Java: 11.0.9 JVM: 11.0.9+7-LTS(Oracle Corporation) Arch: amd64

> Task :compileJava
[22:03:29] [main/INFO]: Writing debug log file accesstransform.log
[22:03:29] [main/INFO]: Access Transformer processor running version 1.0.5+4+02b7b69
[22:03:29] [main/INFO]: Command line arguments [--inJar, C:\Users\Lemon\Desktop\apple\AppleOfMyEye\build\fg_cache\net\minecraftforge\forge\1.16.5-36.1.16\forge-1.16.5-36.1.16-injected.jar, --outJar, C:\Users\Lemon\Desktop\apple\Appl
eOfMyEye\build\fg_cache\net\minecraftforge\forge\1.16.5-36.1.16_mapped_snapshot_20210309-1.16.5\forge-1.16.5-36.1.16_mapped_snapshot_20210309-1.16.5.jar, --logFile, accesstransform.log, --atFile, C:\Users\Lemon\Desktop\apple\AppleOf
MyEye\src\main\resources\META-INF\accesstransformer.cfg, --atFile, C:\Users\Lemon\Desktop\apple\AppleOfMyEye\build\_atJar_5\parent_at.cfg]
[22:03:29] [main/INFO]: Reading from C:\Users\Lemon\Desktop\apple\AppleOfMyEye\build\fg_cache\net\minecraftforge\forge\1.16.5-36.1.16\forge-1.16.5-36.1.16-injected.jar
[22:03:29] [main/INFO]: Writing to C:\Users\Lemon\Desktop\apple\AppleOfMyEye\build\fg_cache\net\minecraftforge\forge\1.16.5-36.1.16_mapped_snapshot_20210309-1.16.5\forge-1.16.5-36.1.16_mapped_snapshot_20210309-1.16.5.jar
[22:03:29] [main/INFO]: Transformer file C:\Users\Lemon\Desktop\apple\AppleOfMyEye\src\main\resources\META-INF\accesstransformer.cfg
[22:03:29] [main/INFO]: Transformer file C:\Users\Lemon\Desktop\apple\AppleOfMyEye\build\_atJar_5\parent_at.cfg
[22:03:29] [main/WARN]: Found existing output jar C:\Users\Lemon\Desktop\apple\AppleOfMyEye\build\fg_cache\net\minecraftforge\forge\1.16.5-36.1.16_mapped_snapshot_20210309-1.16.5\forge-1.16.5-36.1.16_mapped_snapshot_20210309-1.16.5.
jar, overwriting
[22:03:38] [main/INFO]: JAR transformation complete C:\Users\Lemon\Desktop\apple\AppleOfMyEye\build\fg_cache\net\minecraftforge\forge\1.16.5-36.1.16_mapped_snapshot_20210309-1.16.5\forge-1.16.5-36.1.16_mapped_snapshot_20210309-1.16.
Creating SRG -> MCP TSRG
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :addRefMapToJar FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':addRefMapToJar'.
> Gradle 6 was detected but the mixin dependency was missing from one or more Annotation Processor configurations: [annotationProcessor]. To enable the Mixin AP please include the mixin processor artefact in each Annotation Processo
r configuration. For example if you are using mixin dependency 'org.spongepowered:mixin:0.1.2-SNAPSHOT' you should specify the dependency 'org.spongepowered:mixin:0.1.2-SNAPSHOT:processor'. If you believe you are seeing this message
 in error, you can disable this check via the disableAnnotationProcessorCheck() directive.

* 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

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1m 48s
5 actionable tasks: 5 executed

This is when I attempt to `gradlew build` after running a `gradlew clean`. I made the spongeforge stuff identical to yours, my wrapper is at version 6.8.1. It seems to be asking me to include an annotation processor with the ability to disable it. Any ideas? Game runs fine, just building seems to not work.

Link to comment
Share on other sites

Oh, a very good suggestion. There's a message here https://discord.com/channels/313125603924639766/733055378371117127/835920536118493184 that had what I needed :) thank you again, though I don't know how your CameraCraft3 builds without an annotation processor dependency, that seems to be a requirement now, but hell what do I know? Have an excellent day, dude, thanks again

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Terms of Use.