Quick Fix for Most Random Build Errors

Started by _CrimsonInferno_ on Sun, 12/27/2020 - 19:49

Topic category: Troubleshooting, bugs, and solutions

Last seen on 13:02, 3. Mar 2021
Joined May 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Quick Fix for Most Random Build Errors
Mon, 12/28/2020 - 09:24 (edited)

Do you ever have it where you've got a perfectly functioning mod, and then you add one thing and suddenly everything has build errors and you can't seem to get them to go away? Well, so have I, and I found a solution that usually works. It's so simple I almost don't want to dedicate a forum post to it, but whatever. All you usually need to do is hit the button at the top "Regenerate code and build". This button looks like a raffle ticket. Simply press that and the build errors should disappear.

Edited by _CrimsonInferno_ on Mon, 12/28/2020 - 09:24
Pinned this topic :D Indeed…
Mon, 12/28/2020 - 09:26

Pinned this topic :D

Indeed usually code references brake and regenerating code to fix them is all that is needed.

If this does not do the trick, 95 % of the remaining cases are fixed by: https://mcreator.net/wiki/gradle-setup-errors

In some cases, Gradle caches that make sure the build process does not take too long can get corrupted. In such a case, go to:

<your user home folder>/.mcreator/gradle

In this folder, there is a folder called caches. Delete this folder and open MCreator again. Next build will take a bit longer as caches need to be rebuilt. If you can not delete all files in this folder (which is necessary), reboot the computer first to remove any potential file locks.

If this is not enough to make things work, delete the entire gradle folder, not just caches, and try again.

If even this fails, try to delete the entire <your user home folder>/.mcreator/gradle folder, create a new workspace with the same generator version as the version of the workspace failing, after the setup of this new workspace is done, open your current workspace, and click Build & run -> Build workspace, then Build & run -> Reload gradle project and then Build & run -> Regenerate code and build.