nicolasgramlich/AndEngine — Issue #51: IndexOutOfBoundsException
Author: mattjohnpowell
Created: 2012-02-27 16:13:42+00:00
State: open

I get the following error while continuously calling onTap() (by tapping the screen)

02-27 15:40:12.258: E/AndroidRuntime(29378): FATAL EXCEPTION: UpdateThread
02-27 15:40:12.258: E/AndroidRuntime(29378): java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
02-27 15:40:12.258: E/AndroidRuntime(29378):	at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:251)
02-27 15:40:12.258: E/AndroidRuntime(29378):	at java.util.ArrayList.get(ArrayList.java:304)
02-27 15:40:12.258: E/AndroidRuntime(29378):	at org.andengine.util.modifier.ModifierList.onUpdate(ModifierList.java:56)
02-27 15:40:12.258: E/AndroidRuntime(29378):	at org.andengine.entity.Entity.onManagedUpdate(Entity.java:1266)
02-27 15:40:12.258: E/AndroidRuntime(29378):	at org.andengine.entity.sprite.AnimatedSprite.onManagedUpdate(AnimatedSprite.java:114)
02-27 15:40:12.258: E/AndroidRuntime(29378):	at org.andengine.entity.Entity.onUpdate(Entity.java:1040)
02-27 15:40:12.258: E/AndroidRuntime(29378):	at org.andengine.entity.Entity.onManagedUpdate(Entity.java:1276)
02-27 15:40:12.258: E/AndroidRuntime(29378):	at org.andengine.entity.scene.Scene.onManagedUpdate(Scene.java:285)
02-27 15:40:12.258: E/AndroidRuntime(29378):	at org.andengine.entity.Entity.onUpdate(Entity.java:1040)
02-27 15:40:12.258: E/AndroidRuntime(29378):	at org.andengine.engine.Engine.onUpdateScene(Engine.java:563)
02-27 15:40:12.258: E/AndroidRuntime(29378):	at org.andengine.engine.Engine.onUpdate(Engine.java:558)
02-27 15:40:12.258: E/AndroidRuntime(29378):	at org.andengine.engine.Engine.onTickUpdate(Engine.java:520)
02-27 15:40:12.258: E/AndroidRuntime(29378):	at org.andengine.engine.Engine$UpdateThread.run(Engine.java:784)

This is also a stack trace from a market report (unobfuscated) - i believe it is the same

java.lang.IndexOutOfBoundsException: Invalid index 14, size is 2
at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)
at java.util.ArrayList.get(ArrayList.java:311)
at org.andengine.entity.Entity.boolean hasParent()(Unknown Source)
void setAlpha(float)
boolean detachChild(org.andengine.entity.IEntity)

float[] convertSceneToLocalCoordinates(float,float)
void onManagedDraw(org.andengine.opengl.util.GLState,org.andengine.engine.camera.Camera)
at org.andengine.entity.scene.Scene.void onManagedDraw(org.andengine.opengl.util.GLState,org.andengine.engine.camera.Camera)(Unknown Source)
at org.andengine.entity.Entity.void onUpdateColor()(Unknown Source)
void setVisible(boolean)
boolean isCulled(org.andengine.engine.camera.Camera)
void setParent(org.andengine.entity.IEntity)
void setPosition(float,float)
void registerEntityModifier(org.andengine.entity.modifier.IEntityModifier)
void onDraw(org.andengine.opengl.util.GLState,org.andengine.engine.camera.Camera)
void onUpdate(float)
void toString(java.lang.StringBuilder)at org.andengine.engine.Engine.void start()(Unknown Source)
void setScene(org.andengine.entity.scene.Scene)
void setSurfaceSize(int,int)
void setTouchController(org.andengine.input.touch.controller.ITouchController)
void registerUpdateHandler(org.andengine.engine.handler.IUpdateHandler)
boolean onTouchEvent(org.andengine.input.touch.TouchEvent)
void onDrawFrame(org.andengine.opengl.util.GLState)
org.andengine.engine.options.EngineOptions access$0(org.andengine.engine.Engine)
at com.example.livewallpaper.Example$1.void onDrawFrame(org.andengine.opengl.util.GLState)(Unknown Source)
com.apprsd.livewallpaper.Example access$0(com.apprsd.livewallpaper.Example$1)
at org.andengine.opengl.view.EngineRenderer.void onDrawFrame(javax.microedition.khronos.opengles.GL10)(Unknown Source)
at org.andengine.extension.opengl.GLThread.void guardedRun()(Unknown Source)
at org.andengine.extension.opengl.GLThread.void run()(Unknown Source)