java.lang.UnsupportedOperationException: Could not remove Layer because it is not a child of the GroupLayer
at playn.core.GroupLayerImpl.int add(playn.core.GroupLayer,playn.core.AbstractLayer)(Unknown Source)
void remove$64617f06(playn.core.AbstractLayer)
void removeAll$5719e7f()
playn.core.Layer hitTest(playn.core.GroupLayer,pythagoras.f.Point)
int depthChanged$2ddf7efb(playn.core.Layer,float)
void remove(int)
int findChild(playn.core.AbstractLayer,float)
int findInsertion(float)
at playn.core.gl.GroupLayerGL.void remove(playn.core.Layer)(Unknown Source)
void removeAll()
playn.core.Layer hitTestDefault(pythagoras.f.Point)
at tripleplay.game.ScreenStack.int size()(Unknown Source)
void hide(tripleplay.game.Screen)
at tripleplay.game.ScreenStack$2.void onComplete()(Unknown Source)
at tripleplay.game.ScreenStack$Transitor.void complete()(Unknown Source)
at tripleplay.game.ScreenStack$Transitor.void update(int)(Unknown Source)
void paint(playn.core.util.Clock)
void onComplete()
at tripleplay.game.ScreenStack.void push(tripleplay.game.Screen)(Unknown Source)
void push(java.lang.Iterable)
void replace(tripleplay.game.Screen,tripleplay.game.ScreenStack$Transition)
void update(int)
void paint(playn.core.util.Clock)
tripleplay.game.ScreenStack$Transition defaultPushTransition()
void transition(tripleplay.game.ScreenStack$Transitor)
void handleError(java.lang.RuntimeException)
at creek.playn.core.CreekGame.void init()(Unknown Source)
void update(int)
void paint(float)
long access$002(creek.playn.core.CreekGame,long)
com.google.common.base.Optional access$100(creek.playn.core.CreekGame)
com.google.common.base.Optional access$102(creek.playn.core.CreekGame,com.google.common.base.Optional)
at playn.core.Game$Default.void tick(int)(Unknown Source)
at playn.android.AndroidPlatform.void update()(Unknown Source)
at playn.android.GameViewGL$1.void onDrawFrame(javax.microedition.khronos.opengles.GL10)(Unknown Source)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1523)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
You haven't been able to reproduce it reliably, so this may not be all that helpful, but you could at least add a try-catch around the remove operation and put a breakpoint or extra logging statements whenever an UnsupportedOperationException is thrown.
Alternatively, you could change the PlayN code to silently ignore remove calls where the layer is not a child, rather than throw that exception (the same way an ArrayList will accept remove calls for objects not stored in it). Chances are that you'll want to discover what is actually happening to the layers rather than "bury" the problem though - there's no telling what weirdness could arise from whatever is happening.
--
---
You received this message because you are subscribed to a topic in the Google Groups "PlayN" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/playn/nv7gFrVRDTw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to playn+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
03-02 12:31:43.898: E/AndroidRuntime(3299): java.lang.UnsupportedOperationException: Could not remove Layer because it is not a child of the GroupLayer03-02 12:31:43.898: E/AndroidRuntime(3299): at playn.core.GroupLayerImpl.remove(GroupLayerImpl.java:80)03-02 12:31:43.898: E/AndroidRuntime(3299): at playn.core.gl.GroupLayerGL.remove(GroupLayerGL.java:119)03-02 12:31:43.898: E/AndroidRuntime(3299): at tripleplay.game.ScreenStack.hide(ScreenStack.java:333)03-02 12:31:43.898: E/AndroidRuntime(3299): at tripleplay.game.ScreenStack$2.onComplete(ScreenStack.java:107)03-02 12:31:43.898: E/AndroidRuntime(3299): at tripleplay.game.ScreenStack$Transitor.complete(ScreenStack.java:415)03-02 12:31:43.898: E/AndroidRuntime(3299): at tripleplay.game.ScreenStack.transition(ScreenStack.java:351)03-02 12:31:43.898: E/AndroidRuntime(3299): at tripleplay.game.ScreenStack.push(ScreenStack.java:106)03-02 12:31:43.898: E/AndroidRuntime(3299): at tripleplay.game.ScreenStack.push(ScreenStack.java:93)03-02 12:31:43.898: E/AndroidRuntime(3299): at creek.playn.core.CreekGame.init(CreekGame.java:68)03-02 12:31:43.898: E/AndroidRuntime(3299): at playn.android.AndroidPlatform.run(AndroidPlatform.java:158)03-02 12:31:43.898: E/AndroidRuntime(3299): at playn.core.PlayN.run(PlayN.java:74)03-02 12:31:43.898: E/AndroidRuntime(3299): at creek.playn.android.CreekActivity.main(CreekActivity.java:44)03-02 12:31:43.898: E/AndroidRuntime(3299): at playn.android.GameViewGL$3.run(GameViewGL.java:103)03-02 12:31:43.898: E/AndroidRuntime(3299): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1463)03-02 12:31:43.898: E/AndroidRuntime(3299): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)