[Fixed]Library compatibility crash

Hi All,

I’ve got a slight situation here - I’m using an updated version of Nifty as I needed some bug fixes within it. To work with that version of Nifty I needed to rebuild JME against it as some classes had turned into interfaces…so it was source code compatible but not binary compatible.

That all worked perfectly for desktop, however I recently went back to trying it on my phone. Everything seemed fine at first but then I tried to type into a nifty text field and:


W/dalvikvm( 3731): threadid=1: thread exiting with uncaught exception (group=0x4001e578)

E/AndroidRuntime( 3731): FATAL EXCEPTION: main

E/AndroidRuntime( 3731): java.lang.NoSuchMethodError: de.lessvoid.nifty.controls.TextField.setText

E/AndroidRuntime( 3731): at com.jme3.niftygui.InputSystemJme$1.onSoftText(InputSystemJme.java:265)

E/AndroidRuntime( 3731): at com.jme3.system.android.OGLESContext$2$2.onClick(OGLESContext.java:425)

E/AndroidRuntime( 3731): at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:165)

E/AndroidRuntime( 3731): at android.os.Handler.dispatchMessage(Handler.java:99)

E/AndroidRuntime( 3731): at android.os.Looper.loop(Looper.java:130)

E/AndroidRuntime( 3731): at android.app.ActivityThread.main(ActivityThread.java:3691)

E/AndroidRuntime( 3731): at java.lang.reflect.Method.invokeNative(Native Method)

E/AndroidRuntime( 3731): at java.lang.reflect.Method.invoke(Method.java:507)

E/AndroidRuntime( 3731): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)

E/AndroidRuntime( 3731): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:665)

E/AndroidRuntime( 3731): at dalvik.system.NativeStart.main(Native Method)

E/ ( 2704): Dumpstate > /data/log/dumpstate_app_error

W/ActivityManager( 2704): Force finishing activity net.herodex/.MainActivity

I/dumpstate( 3782): begin


I’m guessing this means I need to rebuild/replace some of the android JME libraries as well for the nifty compatibility but I’m not sure which ones I need, where they are etc…the android project config seems quite fiddly and I don’t want to break it by accident!

Any suggestions please?



I think your issue is related to the feature for Android to display the default text input in order to type in text for use by Nifty (since there’s no keyboard). The code is in InputSystemJme in the NiftyGUI folder. The routine that tries to grab the Nifty element and set the text is below.

Line 265 is the [java]textField.setText(text);[/java] in the routine below.

Maybe something changed in how elements are obtained or how text is programmatically set in the new version of Nifty?


private void processSoftKeyboard() {

SoftTextDialogInput softTextDialogInput = JmeSystem.getSoftTextDialogInput();

if (softTextDialogInput != null) {

Element element = nifty.getCurrentScreen().getFocusHandler().getKeyboardFocusElement();

if (element != null) {

final TextField textField = element.getNiftyControl(TextField.class);

if (textField != null && !(textField instanceof TextFieldNull)) {

Logger.getLogger(InputSystemJme.class.getName()).log(Level.INFO, “Current TextField: {0}”, textField.getId());

String initialValue = textField.getText();

if (initialValue == null) {

initialValue = “”;


softTextDialogInput.requestDialog(SoftTextDialogInput.TEXT_ENTRY_DIALOG, “Enter Text”, initialValue, new SoftTextDialogInputListener() {

public void onSoftText(int action, String text) {

if (action == SoftTextDialogInputListener.COMPLETE) {











Thanks a lot.

Once I knew where to find the culprit I was able to strip out the libraries from that project and put in the correct Nifty ones in…rebuilt everything and we are up and running.

The only problem is that all my generated textures seem to be coming up black :frowning: I’ll need to look into that some more but thanks again!