[SOLVED] IncompatibleClassChangeError: Found interface com.jme3.app.Application, but class was expected

Uncaught exception thrown in Thread[jME3 Main,5,main]
IncompatibleClassChangeError: Found interface com.jme3.app.Application, but class was expected

I’ve just loaded a project I last worked on in one of the first versions of 3.1, into the latest version of the 3.1 sdk and several simple scenes run normally, but the one that uses a custom appstate is producing the above error.

The first hit is where I am doing:

this.app = (SimpleApplication) app;

in my initialize method (overriding the method inherited from AbstractAppState) in order to give the appstate access to the app’s methods.

I feel that there must be a simple reason for this that I’m just failing to see and was hoping someone could help.

Thanks for your time!

1 Like

1 Like

Always whenever you see an exception like that or a “missing method definition error” or some such… 99.9999% of the time this indicates “I need to do a clean build”.

After running clean and build I’m still getting the same error, but it moved from my appstate over to

SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.IncompatibleClassChangeError: Found interface com.jme3.app.Application, but class was expected
at com.simsilica.lemur.GuiGlobals.(GuiGlobals.java:127)

So I presume I have to hunt down a newer version of Lemur as well?

You must be using an older one that was compatible with the older JME. I recompiled the library when the change was made. You can see the version here:
https://github.com/jMonkeyEngine-Contributions/Lemur/blob/master/release/Lemur-changelog.txt

Lemur 1.8.1 was when the switch was made.

The version I had was old enough not to have a version number - just “lemur.jar”, I’ve updated it to 1.82 (and slf4j) and now it seems to be working again.

Thank you everyone!

I really wonder what happens on this 0.0001% of the time… must be really scary…

1 Like

Well, we just saw… it was “upgrade your libraries”. :slight_smile:

So there is no room left for “aliens just removed this method from your compiled classes…”?
too bad I was about to make a movie about it…

That’s in the space between the numbers, man. Because… magnets!

I tend to get this error from time to time when using old libraries too, and simply cleaning them won’t always help. So for my own and others reference, here is what I do then:
Remove the import reference to Application from the class in question. Recompile (getting compile error), add it again. Rebuild.