Search Unity

Question Firebase and iOS => symbol(s) not found for architecture arm64

Discussion in 'iOS and tvOS' started by kikdu, Apr 20, 2021.

  1. kikdu

    kikdu

    Joined:
    Mar 22, 2021
    Posts:
    5
    Hello,

    I am building an iOS 14 app that uses Firebase (7.5.0) with Unity 2020. When launching into XCode (12.4), I get this compiling error :

    Code (csharp):
    1. Undefined symbols for architecture arm64:
    2.  
    3.   "_OBJC_CLASS_$_GKLocalPlayer", referenced from:
    4.  
    5.       objc-class-ref in libFirebaseCppAuth.a(credential_ios_7e32949a14fe9694040ff5eed8d1b954.o)
    6.  
    7. ld: symbol(s) not found for architecture arm64
    I tried everything ;

    - uninstall / reinstall cocoapods
    - change the Firebase SDK version
    - open the .xcworkspace file instead of xcproject
    - add some libraries in the build phases and some entries in the build settings (other linker flags)
    - ...

    I still can't get it working...

    Does someone have the good fix please ?

    I am lost...

    Thanks a lot
     
    DungDajHjep likes this.
  2. mike6502

    mike6502

    Joined:
    Oct 5, 2016
    Posts:
    49
    Last edited: Apr 22, 2021
  3. kikdu

    kikdu

    Joined:
    Mar 22, 2021
    Posts:
    5
    Thank you very much !

    Did you also modify the code of the class FIRGameCenterAuthProvider as mentioned in the issue ?
     
  4. mike6502

    mike6502

    Joined:
    Oct 5, 2016
    Posts:
    49
    I only needed to add the GameKit.framework to get the build working locally. I was not successful, however, in getting Unity Cloud Builds to succeed.

    I've rolled back to 7.0.2, and will try again with 7.2.0.
     
  5. kikdu

    kikdu

    Joined:
    Mar 22, 2021
    Posts:
    5
    Where did you rollback the Firebase SDK version ? In the podfile ?
     
  6. mike6502

    mike6502

    Joined:
    Oct 5, 2016
    Posts:
    49
    I meant that I went back to the entire SDK, 7.0.2. In my case, I always upgrade and test the latest Firebase SDKs in a git branch, so I was able to just reset the branch to the previous SDK.

    I should note that I got 7.1.0 working in Unity Cloud Build. I already had a script to add entitlements for Push Notification and GameCenter, so was able to add a couple of lines to add the GameKit framework to the UnityFramework xcode project. Something like this (your entitlement script may look different):

    Code (CSharp):
    1.  
    2.         Debug.Log("[XcodeEntitlements] Embedding gamekit frameworks into UnityFramework target (REMOVE this patch with Firebase SDK update 7.2.0)");
    3.         string unityFrameworkTargetGUID = pbxProject.GetUnityFrameworkTargetGuid();
    4.         pbxProject.AddFrameworkToProject(unityFrameworkTargetGUID, "GameKit.framework", true);
    5.