Hi everyone,
My project is randomly crashing due to ArrayIndexOutOfBounds with the following stack trace:
I have found a couple of other threads from users with this same problem, but no solution.
In my project, the user clicks to create a body at the mouse coordinates. The exception seems to be thrown almost immediately after a new body has been added in this way. I say this because the sprite for the new body is displayed and seems to move just a little before the exception is thrown.
I am not creating an bodies or destroying any bodies within the physics step (no body creation/destruction in my ContactListener implementation). Further, I am only creating bodies using the World.createBody(...) method, I never call "new Body()".
Any help would be greatly appreciated, as I cannot see a pattern to when this exception occurs.
Thanks,
Tom.
My project is randomly crashing due to ArrayIndexOutOfBounds with the following stack trace:
Code: Select all
java.lang.ArrayIndexOutOfBoundsException: length=18; index=18
at org.jbox2d.dynamics.Island.add(Island.java:413)
at org.jbox2d.dynamics.World.solve(World.java:927)
at org.jbox2d.dynamics.World.step(World.java:565)
I have found a couple of other threads from users with this same problem, but no solution.
In my project, the user clicks to create a body at the mouse coordinates. The exception seems to be thrown almost immediately after a new body has been added in this way. I say this because the sprite for the new body is displayed and seems to move just a little before the exception is thrown.
I am not creating an bodies or destroying any bodies within the physics step (no body creation/destruction in my ContactListener implementation). Further, I am only creating bodies using the World.createBody(...) method, I never call "new Body()".
Any help would be greatly appreciated, as I cannot see a pattern to when this exception occurs.
Thanks,
Tom.