Skip to content
This repository has been archived by the owner on Mar 11, 2021. It is now read-only.

Crash on iOS with CCTransitionFade #283

Closed
heiko-holz opened this issue Aug 11, 2015 · 7 comments
Closed

Crash on iOS with CCTransitionFade #283

heiko-holz opened this issue Aug 11, 2015 · 7 comments

Comments

@heiko-holz
Copy link

I have a problem with CCTransitionFade on iOS devices.

var scene = GameScene (this.Window, this.Level);
var trans = new CCTransitionFade (2f, scene);
Director.ReplaceScene (trans);

Sometimes, the following error occurs:

Array index is out of range.
  at CocosSharp.CCRenderer.PushLayerGroup (Microsoft.Xna.Framework.Matrix& viewMatrix, Microsoft.Xna.Framework.Matrix& projMatrix) [0x00000] in <filename unknown>:0 
  at CocosSharp.CCLayer.Visit (CocosSharp.CCAffineTransform& parentWorldTransform) [0x00000] in <filename unknown>:0 
  at CocosSharp.CCNode.Visit (CocosSharp.CCAffineTransform& parentWorldTransform) [0x00000] in <filename unknown>:0 
  at CocosSharp.CCScene.Visit (CocosSharp.CCAffineTransform& parentWorldTransform) [0x00000] in <filename unknown>:0 
  at CocosSharp.CCTransitionSceneContainerNode.VisitRenderer (CocosSharp.CCAffineTransform& worldTransform) [0x00000] in <filename unknown>:0 
  at CocosSharp.CCNodeGrid.Visit (CocosSharp.CCAffineTransform& parentWorldTransform) [0x00000] in <filename unknown>:0 
  at CocosSharp.CCNode.Visit (CocosSharp.CCAffineTransform& parentWorldTransform) [0x00000] in <filename unknown>:0 
  at CocosSharp.CCLayer.Visit (CocosSharp.CCAffineTransform& parentWorldTransform) [0x00000] in <filename unknown>:0 
  at CocosSharp.CCNode.Visit (CocosSharp.CCAffineTransform& parentWorldTransform) [0x00000] in <filename unknown>:0 
  at CocosSharp.CCScene.Visit (CocosSharp.CCAffineTransform& parentWorldTransform) [0x00000] in <filename unknown>:0 
  at CocosSharp.CCNode.Visit () [0x00000] in <filename unknown>:0 
  at CocosSharp.CCWindow.Draw (CocosSharp.CCGameTime gameTime) [0x00000] in <filename unknown>:0 
  at CocosSharp.CCWindow.MainLoop (CocosSharp.CCGameTime gameTime) [0x00000] in <filename unknown>:0 
  at CocosSharp.CCApplication.Draw (Microsoft.Xna.Framework.GameTime gameTime) [0x00000] in <filename unknown>:0 
  at Microsoft.Xna.Framework.Game.<.cctor>b__18 (IDrawable drawable, Microsoft.Xna.Framework.GameTime gameTime) [0x00000] in <filename unknown>:0 
  at Microsoft.Xna.Framework.Game+SortingFilteringCollection`1[Microsoft.Xna.Framework.IDrawable].ForEachFilteredItem[GameTime] (System.Action`2 action, Microsoft.Xna.Framework.GameTime userData) [0x00000] in <filename unknown>:0 
  at Microsoft.Xna.Framework.Game.Draw (Microsoft.Xna.Framework.GameTime gameTime) [0x00000] in <filename unknown>:0 
  at CocosSharp.CCGame.Draw (Microsoft.Xna.Framework.GameTime gameTime) [0x00000] in <filename unknown>:0 
  at Microsoft.Xna.Framework.Game.DoDraw (Microsoft.Xna.Framework.GameTime gameTime) [0x00000] in <filename unknown>:0 
  at Microsoft.Xna.Framework.Game.Tick () [0x00000] in <filename unknown>:0 
  at Microsoft.Xna.Framework.iOSGamePlatform.Tick () [0x00000] in <filename unknown>:0 
  at Microsoft.Xna.Framework.iOSGameView.DoTick () [0x00000] in <filename unknown>:0 
  at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00000] in <filename unknown>:0 
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00000] in <filename unknown>:0 
  at Prosodia.iOS.Application.Main (System.String[] args) [0x00000] in <filename unknown>:0 

When I directly replace the scene Director.ReplaceScene(scene) instead of the transition, it works fine.

@rtabbara
Copy link
Member

@Heikofant Can you try running your app. in debug and seeing whether there are any assert messages of the form "Maximum layer depth of 100 reached". That would give us a clue as to origin of the issue.

You said that this occurs sometimes. Is it dependent on the particular scene you're rendering?

@heiko-holz
Copy link
Author

@rtabbara Yes, it depends on the scene and the device I am using. I get no errors on the simulator but on my real iPhone 4s. It also depends from which scene I am transitioning.
I have my scene B, when I transition into it from scene A, everything is fine, but when I try to transition from scene C, I get the error.

I get no assert messages when running in debug, just the error message.

@rtabbara
Copy link
Member

@Heikofant Just to be sure, can you confirm whether or not you're observing the issue when deploying to the device in both debug and release mode? Either way, please provide the version of the iOS SDK and Xam.iOS that you're using and we'll take a closer look.

@heiko-holz
Copy link
Author

The issue is present on Debug and Release builds.

iOS SDK: 8.4
Xam.iOS: 8.10.4.46
CocosSharp: 1.5.0.1

@heiko-holz
Copy link
Author

Today I also got the error on my Android device (LG Nexus 4)

[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] System.IndexOutOfRangeException: Array index is out of range.
[MonoDroid] at CocosSharp.CCRenderer.PushLayerGroup (Microsoft.Xna.Framework.Matrix&,Microsoft.Xna.Framework.Matrix&) <IL 0x0004d, 0x00144>
[MonoDroid] at CocosSharp.CCLayer.Visit (CocosSharp.CCAffineTransform&) <IL 0x0003b, 0x0028f>
[MonoDroid] at CocosSharp.CCNode.Visit (CocosSharp.CCAffineTransform&) <IL 0x0006f, 0x003c3>
[MonoDroid] at CocosSharp.CCNode.Visit (CocosSharp.CCAffineTransform&) <IL 0x0006f, 0x003c3>
[MonoDroid] at CocosSharp.CCLayer.Visit (CocosSharp.CCAffineTransform&) <IL 0x0004a, 0x0030b>
[MonoDroid] at CocosSharp.CCNode.Visit (CocosSharp.CCAffineTransform&) <IL 0x0006f, 0x003c3>
[MonoDroid] at CocosSharp.CCScene.Visit (CocosSharp.CCAffineTransform&) <IL 0x0001b, 0x00173>
[MonoDroid] at CocosSharp.CCTransitionSceneContainerNode.VisitRenderer (CocosSharp.CCAffineTransform&) <IL 0x00017, 0x000ef>
[MonoDroid] at CocosSharp.CCNodeGrid.Visit (CocosSharp.CCAffineTransform&) <IL 0x00091, 0x0051f>
[MonoDroid] at CocosSharp.CCNode.Visit (CocosSharp.CCAffineTransform&) <IL 0x0006f, 0x003c3>
[MonoDroid] at CocosSharp.CCLayer.Visit (CocosSharp.CCAffineTransform&) <IL 0x0004a, 0x0030b>
[MonoDroid] at CocosSharp.CCNode.Visit (CocosSharp.CCAffineTransform&) <IL 0x0006f, 0x003c3>
[MonoDroid] at CocosSharp.CCScene.Visit (CocosSharp.CCAffineTransform&) <IL 0x0001b, 0x00173>
[MonoDroid] at CocosSharp.CCNode.Visit () <IL 0x00009, 0x000b3>
[MonoDroid] at CocosSharp.CCWindow.Draw (CocosSharp.CCGameTime) <IL 0x00044, 0x002f7>
[MonoDroid] at CocosSharp.CCWindow.MainLoop (CocosSharp.CCGameTime) <IL 0x0002f, 0x00243>
[MonoDroid] at CocosSharp.CCApplication.Draw (Microsoft.Xna.Framework.GameTime) <IL 0x00062, 0x0033f>
[MonoDroid] at Microsoft.Xna.Framework.Game.<.cctor>b__18 (Microsoft.Xna.Framework.IDrawable,Microsoft.Xna.Framework.GameTime) <IL 0x00002, 0x0005b>
[MonoDroid] at Microsoft.Xna.Framework.Game/SortingFilteringCollection`1<Microsoft.Xna.Framework.IDrawable>.ForEachFilteredItem<Microsoft.Xna.Framework.GameTime> (System.Action`2<Microsoft.Xna.Framework.IDrawable, Microsoft.Xna.Framework.GameTime>,Microsoft.Xna.Framework.GameTime) <0x003df>
[MonoDroid] at Microsoft.Xna.Framework.Game.Draw (Microsoft.Xna.Framework.GameTime) <IL 0x0000c, 0x0006b>
[MonoDroid] at CocosSharp.CCGame.Draw (Microsoft.Xna.Framework.GameTime) <IL 0x00002, 0x0004b>
[MonoDroid] at Microsoft.Xna.Framework.Game.DoDraw (Microsoft.Xna.Framework.GameTime) <IL 0x0001e, 0x0010f>
[MonoDroid] at Microsoft.Xna.Framework.Game.Tick () <IL 0x001f5, 0x00d2f>
------ AndroidEnvironment.UnhandledExceptionRaiser Handling ------
[MonoDroid] at Microsoft.Xna.Framework.AndroidGameWindow.OnUpdateFrame (object,OpenTK.FrameEventArgs) <IL 0x00059, 0x00257>
[MonoDroid] at OpenTK.GameViewBase.OnUpdateFrame (OpenTK.FrameEventArgs) [0x00014] in /Users/builder/data/lanes/1978/f98871a9/source/opentk/Source/OpenTK/Platform/Android/GameViewBase.cs:313
[MonoDroid] at OpenTK.Platform.Android.AndroidGameView.UpdateFrameInternal (OpenTK.FrameEventArgs) [0x00013] in /Users/builder/data/lanes/1978/f98871a9/source/opentk/Source/OpenTK/Platform/Android/AndroidGameView.cs:349
[MonoDroid] at OpenTK.Platform.Android.AndroidGameView.RunIteration (System.Threading.CancellationToken) [0x00096] in /Users/builder/data/lanes/1978/f98871a9/source/opentk/Source/OpenTK/Platform/Android/AndroidGameView.cs:569
[MonoDroid] at OpenTK.Platform.Android.AndroidGameView/<StartThread>c__AnonStorey0.<>m__0 (object) [0x0000d] in /Users/builder/data/lanes/1978/f98871a9/source/opentk/Source/OpenTK/Platform/Android/AndroidGameView.cs:459
[MonoDroid] at Android.App.SyncContext/<Send>c__AnonStorey1.<>m__0 () [0x00000] in /Users/builder/data/lanes/1978/f98871a9/source/monodroid/src/Mono.Android/src/Android.App/SyncContext.cs:32
[MonoDroid] at Java.Lang.Thread/RunnableImplementor.Run () [0x0000b] in /Users/builder/data/lanes/1978/f98871a9/source/monodroid/src/Mono.Android/src/Java.Lang/Thread.cs:36
[MonoDroid] at Java.Lang.IRunnableInvoker.n_Run (intptr,intptr) [0x00009] in /Users/builder/data/lanes/1978/f98871a9/source/monodroid/src/Mono.Android/platforms/android-21/src/generated/Java.Lang.IRunnable.cs:71
[MonoDroid] at (wrapper dynamic-method) object.c33e21af-2a0c-4890-9072-8e90f1fb64a0 (intptr,intptr) <IL 0x00011, 0x0003b>

@kjpou1
Copy link
Contributor

kjpou1 commented Aug 19, 2015

@Heikofant and @rtabbara has this been resolved? If not then @Heikofant can we maybe get an example of this failing please.

@kjpou1
Copy link
Contributor

kjpou1 commented Sep 9, 2015

No response as of yet. Will close this for now for lack of information. Please reopen when more information can be obtained from user.

@kjpou1 kjpou1 closed this as completed Sep 9, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants