Search Unity

Firebase and Unity iOS build crashes at startup

Discussion in 'iOS and tvOS' started by Brathnann, Mar 23, 2017.

  1. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,187
    We've added Firebase to our project and were able to get the Dynamic link feaure working fine on Android. We then tried to set it up in our iOS build and after a bit of struggle, were able to get it built out.

    However, when we try to run the game, it crashes off the bat. Does anybody have an idea of what may be creating this issue? Is there something we can use that allows us to detect the crash error? (like logcat for Android).

    We also tried an empty project that just had a text box in it and it was crashing at the start as well.

    Thank you for any help you may provide.
     
    Last edited: Mar 23, 2017
    alecfilios and tonybf like this.
  2. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
    iOS generates crash reports that are stored on the device and can then be retrieved. you can then diagnose what went wrong (most of the times).

    Also, did you try running your game on a device debugging & attached to Xcode ? it should pause execution and show you the exact location in code where it is crashing.
     
  3. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,187
    Yes, I just located the error after some google searching I was able to find the crash reports in the settings.

    It gives the following. Dyid Error Message:
    Library not loaded: /System/Library/Frameworks/UserNotifiations.frameowrk/UserNotifications
    Referenced from...
    Reason: Image not found
    Dyid version: 353.12

    I'm afraid I'm not the Apple guy and know very little on debugging Apple builds. All I see is I tap the icon, it appears like it's opening something, but then it crashes.
     
  4. liortal

    liortal

    Joined:
    Oct 17, 2012
    Posts:
    3,562
  5. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,187
    Ah, not that urgent. We're working with the Firebase team. It's very possible its a bug in their SDK. Just trying to see if others have the issue. We're got it loading now, but there is another issue happening, so I was just seeing if others have the same issue that might be using Firebase.
     
  6. tonybf

    tonybf

    Joined:
    Dec 24, 2017
    Posts:
    9
    @Brathnann I have the same problem. Did you find the solution?
     
  7. Brathnann

    Brathnann

    Joined:
    Aug 12, 2014
    Posts:
    7,187
    I actually haven't touched the dynamic links section of Firebase for a long time. However, we re-visited Firebase recently and the latest sdk doesn't crash on iOS, so it's possible the dynamic links are working better now.

    The one thing I'd say to make sure is that on iOS, all the libraries for Firebase are being included.
     
  8. alecfilios

    alecfilios

    Joined:
    May 21, 2019
    Posts:
    10
    Was a solution ever found?
     
  9. Daryl_1

    Daryl_1

    Joined:
    Feb 13, 2014
    Posts:
    22
    I recently had a similar issue, I'm not sure if it will fix your specific case though. But my workaround is currently:

    In Unity -> Disable 'Enable Swift Framework Support Workaround' in the iOS Resolver Settings (Assets -> External Dependency Manager -> iOS Resolver)

    Then in xCode, just add a swift file to the project (keep it with the auto generated contents) and say yes to 'Create Bridging Header'

    I didn't get as far as to testing if it was the clang setting or swift version part of the workaround that causes the issue in my case. But mine was simply as soon as i added firebase, it crashed on start with the UnityFramework.Framework could not be loaded / image not found (something like that). It worked fine as soon as I removed firebase, so I managed to narrow it down to that setting, but the swift file was still needed (which is part of the external dependency manager swift workaround)


    I hope someone else finds this useful!