I'll preface this by saying that I made an error by walking away from my code after a long session of coding. To my dismay I'm now receiving an IndexOutOfBoundsException when I do a certain function in the game I'm developing. I'd love to post the code to help locate the problem. The thing is I'm having trouble finding where in my 3,500 + lines of code the problem really lies. I've tried removing a few different methods in hopes that it would reveal the culprit but this was to no avail. Here is what I do know for sure.
I set a break point at a place in the code slightly before where The error occurs. The method I placed it before runs and finishes with no problem according to log entries I set in the logcat.
in debug mode it seems that the engine is catching an exception. Here is the logcat message:
12-15 00:41:46.866: E/AndroidRuntime(3395): FATAL EXCEPTION: UpdateThread 12-15 00:41:46.866: E/AndroidRuntime(3395): java.lang.IndexOutOfBoundsException: Invalid index 6, size is 6 12-15 00:41:46.866: E/AndroidRuntime(3395): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251) 12-15 00:41:46.866: E/AndroidRuntime(3395): at java.util.ArrayList.get(ArrayList.java:304) 12-15 00:41:46.866: E/AndroidRuntime(3395): at org.andengine.engine.handler.UpdateHandlerList.onUpdate(UpdateHandlerList.java:47) 12-15 00:41:46.866: E/AndroidRuntime(3395): at org.andengine.entity.Entity.onManagedUpdate(Entity.java:1395) 12-15 00:41:46.866: E/AndroidRuntime(3395): at org.andengine.entity.scene.Scene.onManagedUpdate(Scene.java:284) 12-15 00:41:46.866: E/AndroidRuntime(3395): at org.andengine.entity.Entity.onUpdate(Entity.java:1167) 12-15 00:41:46.866: E/AndroidRuntime(3395): at org.andengine.engine.Engine.onUpdateScene(Engine.java:591) 12-15 00:41:46.866: E/AndroidRuntime(3395): at org.andengine.engine.Engine.onUpdate(Engine.java:586) 12-15 00:41:46.866: E/AndroidRuntime(3395): at org.andengine.engine.FixedStepEngine.onUpdate(FixedStepEngine.java:52) 12-15 00:41:46.866: E/AndroidRuntime(3395): at org.andengine.engine.Engine.onTickUpdate(Engine.java:548) 12-15 00:41:46.866: E/AndroidRuntime(3395): at org.andengine.engine.Engine$UpdateThread.run(Engine.java:820)
Is anyone familiar with a problem similiar to this? I've read a few posts about similar problems where there was an object being disposed causing the error. I'd love it if that were the case, I just cant find anything that would be getting disposed and causing this problem.