LibGDX controllers: how to fix crashes in JRuby?


Posted by: Evan Walsh on 08/21/2015 | Add Revision

I'm using JRuby with LibGDX and it's been going quite swimmingly, save for a crash I experience every time I try to use the controllers extension.

Here's a basic rundown:

  1. I've required all the related jars (gdx-controllers.jar, gdx-controllers-desktop.jar, and gdx-controllers-desktop-natives.jar).
  2. I've imported the controllers package via import "com.badlogic.gdx.controllers".
  3. I call Controllers.controllers, which goes to the getControllers method.
  4. My game crashes with this error:

    libc++abi.dylib: terminating with uncaught exception of type OIS::Exception: CocoaInputManager::_parseConfigSettings >> Unable to find a window or event target

I think the error is due to a lack of a view being passed to OIS library (here's an online view of a related source).

How do I prevent the controllers extension from crashing my game? More importantly, how do I make it work? :)

Visit Website