OSX Gamepad.GetState() Null Exception

I recently ported our game over to OSX, and am getting a null reference exception on Gamepad.GetState(…);

I see a discussion going on at: https://github.com/mono/MonoGame/issues/3790

Was anyone here able to get past this? Is this affecting everyone?

I have the same issue. If I just create a fresh monogame (MonoMac) solution, I don’t have any issues yet. Despite installing 3.4, the version listed under the Packages folder says 3.3.0 and indicates that there’s an update available. When I tell it to go ahead and update to 3.4, that’s when I run into the same issue as you. Have you found a solution?

Does using Joystick.GetState() also create null exception?

Warning, Joystick is only implemented in WinGL, OS X and Linux.

It doesn’t. What it does do though is instead of the expected blue screen it’s a hung grey one. Even clicking the stop button in Xamarin Studio doesn’t stop it from running; I have to force quit. However, if I get rid of Gamepad and Joystick, leaving in just the Keyboard check – no null exception.

When I created a new solution, the problem went away, but I noticed the solution was using MonoGame 3.3.0. As soon as I updated to 3.4, the crash returns.

Same, that still occurs. I hope I don’t need the Gamepad.GetState() portion of the check because it’s gone now so that I can use 3.4.

You will need it if you want to use controllers. Keyboard input will work fine.

I also got a chance to try Joystick.GetState(). I used the default project and just swapped out the gamepad call for a joystick one. I am seeing the same behavior as sammyw. I get a grey screen that hangs that I have to force quit. No NRE.

Same here. Seems a new bug in 3.4

Look at the last post in https://github.com/mono/MonoGame/issues/3790