Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

IOS game version crash alternately when getting notification on device

Discussion in 'iOS and tvOS' started by Naamani, Jan 18, 2016.

  1. Naamani

    Naamani

    Joined:
    Jan 13, 2015
    Posts:
    19
    Hi,

    Sometime when getting a notification (tried with some different ones - SMS, Facebook chat, whatsapp, etc) - the game crashes.
    Using AdMob and google play services. Xcode 7.2, unity 5.3.1
    Test with several devices and IOS versions, all the same. Android works great.
    Appreciate your advice.
    Thanks!

    Crash Logs:
    --------------------------------------
    Thread 0 name: main Dispatch queue: com.apple.main-thread
    Thread 0 Crashed:
    0 <myapp> 0x000000010009905c CrashedCheckBellowForHintsWhy() (CrashReporter.mm:97)
    1 <myapp> 0x00000001019c6aec il2cpp::vm::Runtime::CallUnhandledExceptionDelegate(Il2CppDomain*, Il2CppDelegate*, Il2CppObject*) (Runtime.cpp:345)
    2 <myapp> 0x00000001019c6a6c il2cpp::vm::Runtime::UnhandledException(Il2CppObject*) (Runtime.cpp:435)
    3 <myapp> 0x000000010131e430 ScriptingInvocationNoArgs::Invoke(ScriptingException**) (ScriptingInvocationNoArgs.cpp:131)
    4 <myapp> 0x000000010131e384 ScriptingInvocationNoArgs::Invoke() (ScriptingInvocationNoArgs.cpp:95)
    5 <myapp> 0x00000001013139d4 MonoBehaviour::CallUpdateMethod(int) (MonoBehaviour.cpp:541)
    6 <myapp> 0x00000001011f3420 void BaseBehaviourManager::CommonUpdate<BehaviourManager>() (Behaviour.cpp:169)
    7 <myapp> 0x00000001012ce5b8 PlayerLoop(bool, bool, IHookEvent*) (Player.cpp:1728)
    8 <myapp> 0x000000010150289c UnityPlayerLoopImpl(bool) (LibEntryPoint.mm:240)
    9 <myapp> 0x000000010008fc14 UnityRepaint (UnityAppController+Rendering.mm:238)
    10 <myapp> 0x000000010008fa40 -[UnityAppController(Rendering) repaintDisplayLink] (UnityAppController+Rendering.mm:54)
    11 QuartzCore 0x0000000186647814 0x1865ec000 + 374804
    12 QuartzCore 0x00000001866476c8 0x1865ec000 + 374472
    13 IOKit 0x00000001841721e8 0x18416c000 + 25064
    14 CoreFoundation 0x0000000183e9f1f8 0x183dd8000 + 815608
    15 CoreFoundation 0x0000000183eb5634 0x183dd8000 + 906804
    16 CoreFoundation 0x0000000183eb4d6c 0x183dd8000 + 904556
    17 CoreFoundation 0x0000000183eb2ac4 0x183dd8000 + 895684
    18 CoreFoundation 0x0000000183de1680 0x183dd8000 + 38528
    19 GraphicsServices 0x00000001852f0088 0x1852e4000 + 49288
    20 UIKit 0x0000000188c58d90 0x188bdc000 + 511376
    21 <myapp> 0x00000001000898d0 main (main.mm:32)
    22 libdyld.dylib 0x00000001839828b8 0x183980000 + 10424

    Activity ID: 0x0000000000060dc6
    Activity Name: starting resolver activity
    Activity Image Path: /usr/lib/system/libsystem_network.dylib
    Activity Image UUID: 8668F3C7-D258-3A85-8E98-2E431FF0029B
    Activity Offset: 0x00032060
    Activity Running Time: 37.497428 sec

    Trace Messages (reverse chronological seconds):
    17.165991 AppleJPEG 0x0000000185564ff4 [0x15df63200] Decoding completed without errors
    17.166272 AppleJPEG 0x000000018556318c [0x15df63200] Options: 96x96 [FFFFFFFF,FFFFFFFF] 00025060
    17.166272 AppleJPEG 0x0000000185563044 [0x15df63200] Decoding: C0 0x00600060 0x0000304A 0x11111100 0x00000000 3167
    17.168716 AppleJPEG 0x0000000185562338 [0x15df63200] Created session
    17.168797 AppleJPEG 0x0000000185562b54 [0x15d44ec00] Releasing session
    19.060228 CFNetwork 0x0000000208019da8 Format not found
    19.064490 CFNetwork 0x0000000208019da8 Format not found
    19.064585 CFNetwork 0x0000000184578708 TCP Conn 0x15e5a8830 started
    20.645180 CFNetwork 0x0000000208019da8 Format not found
    20.645670 CFNetwork 0x0000000208019da8 Format not found
    20.645697 CFNetwork 0x0000000184578708 TCP Conn 0x15e57e440 started
    36.888395 CFNetwork 0x0000000208019da8 Format not found
    36.889783 CFNetwork 0x0000000208019da8 Format not found
    36.889816 CFNetwork 0x0000000184578708 TCP Conn 0x15e3d6790 started
    36.891027 CFNetwork 0x00000001845cd8bc Creating default cookie storage with default identifier
    36.891027 CFNetwork 0x00000001845cd888 Faulting in CFHTTPCookieStorage singleton
    36.891027 CFNetwork 0x000000018461f558 Faulting in NSHTTPCookieStorage singleton
    36.937848 libsystem_network.dylib 0x0000000207659da8 Format not found
    37.005042 libsystem_network.dylib 0x0000000207659da8 Format not found
    37.495640 libsystem_network.dylib 0x0000000207659da8 Format not found
     
    Last edited: Jan 19, 2016
  2. Mikea15

    Mikea15

    Joined:
    Sep 20, 2012
    Posts:
    93
    I'm having the same issue with unity 5.3.0f4.

    But also when I go out of the game, and when I enter back. So I guess its when the game enters foreground that something goes wrong.
     
  3. Naamani

    Naamani

    Joined:
    Jan 13, 2015
    Posts:
    19
    I solved it
    (even though it's not clear why it occurs on IOS and not on Android, and why only when getting notifications).

    After I've reproduce he issue with an iPhone plugged in, xcode showed extra info on the crash:
    Unhandled Exception: System.ArgumentException: Index out of bounds.
    at UnityEngine.Input.GetTouch (Int32 index) [0x00000] in <filename unknown>:0
    at <myFunction> () [0x00000] in <filename unknown>:0
    at <myFunction>.Update () [0x00000] in <filename unknown>:0
    UnityEngine.Logger:Log(LogType, Object)
    UnityEngine.Debug:LogError(Object)
    UnityEngine.UnhandledExceptionHandler:printException(String, Exception)
    UnityEngine.UnhandledExceptionHandler:HandleUnhandledException(Object, UnhandledExceptionEventArgs)


    I googled it and stumbled upon these:
    http://answers.unity3d.com/questions/650155/unityexception-index-out-of-bounds.html
    http://answers.unity3d.com/questions/25223/index-out-of-bounds.html
    http://answers.unity3d.com/questions/684744/index-out-of-bounds-error-i-have-this-error-stacki.html

    I was accessing "Input.GetTouch (0)" in <myFunction>, so added a check before (Input.touchCount > 0), and it seems to solve the issue.

    Still - I was using the "GetTouch(0)" in a function within a function where I checked that the user touches the screen. Moreover, it works great on Android. Probably some issue with IOS, notifications, and this array.

    Good luck.