I have following errors which I have no idea about:
06-08 19:59:54.367: E/AndroidRuntime(11629): FATAL EXCEPTION: UpdateThread
06-08 19:59:54.367: E/AndroidRuntime(11629): java.lang.IndexOutOfBoundsException: Invalid index 11, size is 0
06-08 19:59:54.367: E/AndroidRuntime(11629): at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
06-08 19:59:54.367: E/AndroidRuntime(11629): at java.util.ArrayList.get(ArrayList.java:304)
06-08 19:59:54.367: E/AndroidRuntime(11629): at org.andengine.entity.Entity.onManagedUpdate(Entity.java:1402)
06-08 19:59:54.367: E/AndroidRuntime(11629): at org.andengine.entity.scene.Scene.onManagedUpdate(Scene.java:284)
06-08 19:59:54.367: E/AndroidRuntime(11629): at org.andengine.entity.Entity.onUpdate(Entity.java:1167)
06-08 19:59:54.367: E/AndroidRuntime(11629): at org.andengine.engine.Engine.onUpdateScene(Engine.java:591)
06-08 19:59:54.367: E/AndroidRuntime(11629): at org.andengine.engine.Engine.onUpdate(Engine.java:586)
06-08 19:59:54.367: E/AndroidRuntime(11629): at org.andengine.engine.Engine.onTickUpdate(Engine.java:548)
06-08 19:59:54.367: E/AndroidRuntime(11629): at org.andengine.engine.Engine$UpdateThread.run(Engine.java:820)
I believe it's something related with the onManagedUpdate() inside a MoveModifier I used inside my code.
This is almost always due to detaching entities in the wrong thread. Check for anywhere that you might be detaching entities in response to a user interaction, or in a Modifier callback, and wrap it in runOnUpdateThread
. E.g.:
@Override
public void onModifierFinished(IModifier<IEntity> pModifier, IEntity pItem) {
engine.runOnUpdateThread(new Runnable() {
@Override
public void run() {
widget.detachSelf();
}
});
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With