FAQ for diagnosing and resolving build and test failures
Purpose: Reference guide for diagnosing and resolving build failures, test failures, and other development environment issues.
When to use: When encountering unexpected build or test failures, especially those that seem environment-related rather than code-related.
Symptoms:
File /path/to/neoforge-1.21.2/build/resources/main is not a valid mod file
Caused by: java.lang.IllegalArgumentException: Illegal version number specified version (main)
Cause: IDE (IntelliJ IDEA, Eclipse) generated bin/ directories containing unprocessed resource files. The neoforge.mods.toml in bin/main/META-INF/ has version="${version}" instead of the actual version number.
Solution:
rm -rf neoforge-1.21.2/bin common-1.21.2/bin
./gradlew cleanAll
Prevention:
bin/ to .gitignore (already done in this project)Reference: Discovered 2026-01-25 during portal GameTest implementation.
Symptoms:
Cause:
FabricGameTest.EMPTY_STRUCTURE constant (built-in)Solution: For NeoForge, create a proper NBT structure file:
empty_test.nbt in common-{version}/src/main/resources/data/chronodawn/structure/"chronodawn:empty_test" in test configurationNote: The structure must be large enough for the test content (e.g., 10x10x10 for portal frame tests).
Symptoms:
Solution:
./gradlew --stop
./gradlew cleanAll
Checklist:
./gradlew cleanAll to remove stale bin/ directoriesSymptoms:
Failed to lock the level ... session.lock
Cause: Previous test run left a lock file.
Solution:
The gameTestAll task already handles this by cleaning stale world directories. If it persists:
rm -rf fabric-*/run/gametestworld
rm -rf neoforge-*/run/gametestworld
When encountering a new build/test issue: