Error: cannot find symbol

Started by Afacto on

Topic category: Troubleshooting, bugs, and solutions

Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Error: cannot find symbol

Hi, I discovered this while regenerating the code on my mod. I tried regenerating several times but it didn't make a change. I am using an M1 mac. (I deleted a few unimportant parts) It says "cannot find symbol" and this randomly popped up; I haven't had this before and I haven't made any changes since then. I'm not sure if this the reason why MCreator crashes when I load this workspace into a version newer than 2022.1 and I can't work on it on those versions. All these blocks are blocks with a GUI and that variable defined is one that it automatically created so I don't know how to fix it. Can anyone understand the reason? Thanks in advance.

Here's part of the build log

_____

> Task :compileJava
/Users/user/MCreatorWorkspaces/afacto_minecraft_edition_1_1/src/main/java/com/afactohq/afactominecraftedition/block/entity/SteelMillBlockEntity.java:92: error: cannot find symbol  return new SteelMillGUIMenu(id, inventory, new FriendlyByteBuf(Unpooled.buffer()).writeBlockPos(this.worldPosition));
  ^
symbol: class SteelMillGUIMenu
location: class SteelMillBlockEntity
12 errors
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
BUILD FAILED in 9s
1 actionable task: 1 executed

BUILD FAILED
Task completed in 15 seconds
Joined Feb 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
It seems that MCreator doesn…
Sat, 05/27/2023 - 17:46

It seems that MCreator doesn't find SteelMillGuiMenu Class.

Do you have a Mod Element locked?

Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There shouldn't be, there…
Sun, 05/28/2023 - 02:37

There shouldn't be, there are 12 errors that say the same thing but with different blocks with GUIs

Joined May 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Part of the code around that…
Sun, 05/28/2023 - 02:40

Part of the code around that line:

@Override
public AbstractContainerMenu createMenu(int id, Inventory inventory) {
return new SteelMillGUIMenu(id, inventory, new FriendlyByteBuf(Unpooled.buffer()).writeBlockPos(this.worldPosition));
}
 
Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I believe it comes from…
Mon, 07/10/2023 - 07:22

I believe it comes from broken custom java models. Not sure though. I think you need to delete the element that's using the model then remake it from scratch. Hope this helps!

 

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Looking at the code, I…
Mon, 07/10/2023 - 07:38

Looking at the code, I believe this is the case.

Joined Jun 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I believe to have found a…
Sat, 06/29/2024 - 20:09

I believe to have found a solution. I had the same issue with Geckolib models. My solution was to delete then re-import the models. Gradle was happy after that. Maybe it will help with your problem as well