rss
12/10/2025, 9:54 PMmatt.aguirre
12/11/2025, 4:32 PMmatt.aguirre
12/11/2025, 4:33 PMShort answer: Yes — this happens because Grails 4 tightened static compilation rules, and if this method is being added dynamically (via metaClass, traits, AST transforms, or GORM enhancements), then static compilation can no longer "see" it, so it throws MissingMethodException at compile time instead of runtime.
But that doesn't necessarily mean you must skip static analysis — just that you need to know why it's happening and pick the right fix.
Why This Happens in Grails 4
Grails 3 allowed a lot more "magical" dynamic method resolution, especially from:
GORM dynamic methods
Constraints DSL
AST transforms (e.g., @Validateable)
MetaClass method injection
Grails 4 upgrades Groovy to 2.5 and changes how static compilation (@CompileStatic) works:
➡️ Static compilation no longer recognizes dynamically-added methods.
If something like findConstraintsEvaluator() came from a plugin or metaclass injection, @CompileStatic will complain.
MissingMethodException with no signature found = compiler couldn't see the dynamically injected method.
How to Confirm This Is the Issue
Check the class or method where the exception is coming from:
Is it annotated with @CompileStatic or @CompileStatic(TypeCheckingMode.SKIP)?
Did you recently migrate a class from dynamic Groovy to static Groovy?
Is the method you're calling coming from Grails constraints system, metaclass injection, or a plugin?
If the code worked in Grails 3 but fails in Grails 4 only when static compilation is involved — you've found your culprit.Artur Czocher
12/16/2025, 12:03 AMError: Could not find or load main class grails.plugin.json.view.JsonViewCompiler
I try to set version by version to fit it into 4.0.4
jsonViewsVersion=2.0.3
and
classpath "org.grails.plugins:views-gradle:$jsonViewsVersion"
...
implementation "org.grails.plugins:views-json:$jsonViewsVersion"
implementation "org.grails.plugins:views-json-templates:$jsonViewsVersion"
but nothing works. I don’t want to upgrade gradle version now to use 2.1.*. Why I can’t find a version. Is it possible there is a good one…? Don’t think so…