Facebook-sdk-for-unity: 9.1.0 - Undefined symbol: _IOSFBEnableProfileUpdatesOnAccessTokenChange

Created on 13 Apr 2021  ·  22Comments  ·  Source: facebook/facebook-sdk-for-unity

Checklist

Environment

Describe your dev environment here, giving as many details as possible. If you have them, make sure to include:

  • Unity Editor Version: 2020.1.17
  • Unity SDK Version: 9.1.0
  • Installation Platform & Verison: [iOS] version X.X.X
  • XCode: 12.4 (Highest version available in Unity Cloud Build)

Goals

What do you want to achieve?
Trying to build in Unity Cloud Build and local XCode with 9.1.0 FB SDK.

Expected Results

What do you expect to happen?
For XCode to build successfully after updating the facebook unity sdk.

Actual Results

What actually happened? Can you provide a stack trace?
50424: ▸ Linking UnityFramework
50425: ▸ ❌; Undefined symbols for architecture arm64
50426: ▸ > Symbol: _IOSFBEnableProfileUpdatesOnAccessTokenChange
50427: ▸ > Referenced from: _IOSWrapper_EnableProfileUpdatesOnAccessTokenChange_m7ADB5E4C2DE8D7EB448729C43F65D1FFECB5F0CC in Facebook.Unity.IOS.o
50428: ▸ ❌; ld: symbol(s) not found for architecture arm64
50439: ▸ ❌; clang: error: linker command failed with exit code 1 (use -v to see invocation)

Steps to Reproduce

What are the steps necessary to reproduce this issue?
Add the SDK to Unity 2020.1.17f, do an IOS build. Make sure to use cocoapods.

Code Samples & Details

Please provide a code sample, as well as any additional details, to help us track down the issue. If you can provide a link to a test project that allows us to reproduce the issue, this helps us immensely in both the speed and quality of the fix.

Note: Remember to format your code for readability:

// INSERT YOUR CODE HERE
bug

Most helpful comment

Put following code before the } at the end of FBUnityInterface.mm file located in FacebookSDK/SDK/Editor/iOS

  void IOSFBEnableProfileUpdatesOnAccessTokenChange(bool enable)
  {
    [[FBUnityInterface sharedInstance] IOSFBEnableProfileUpdatesOnAccessTokenChange:enable];
  }

All 22 comments

me too.

For now, you can comment the line below in the "Facebook.Unity.IOS.cpp" file

reinterpret_cast(IOSFBEnableProfileUpdatesOnAccessTokenChange)(static_cast<int32_t>(___enable0));

to make it build successfully, but it's NOT the best and final solution.
it's a definitely temporary solution, someone has a better answer?

Put following code before the } at the end of FBUnityInterface.mm file located in FacebookSDK/SDK/Editor/iOS

  void IOSFBEnableProfileUpdatesOnAccessTokenChange(bool enable)
  {
    [[FBUnityInterface sharedInstance] IOSFBEnableProfileUpdatesOnAccessTokenChange:enable];
  }

I'm seeing the same error:

Undefined symbols for architecture arm64: "_IOSFBEnableProfileUpdatesOnAccessTokenChange", referenced from: _IOSWrapper_EnableProfileUpdatesOnAccessTokenChange_m7ADB5E4C2DE8D7EB448729C43F65D1FFECB5F0CC in Facebook.Unity.IOS.o _IOSWrapper_IOSFBEnableProfileUpdatesOnAccessTokenChange_m7E35B38EDDDF18DE2B0B960DA8269D277C8FBCAB in Facebook.Unity.IOS.o (maybe you meant: _IOSWrapper_IOSFBEnableProfileUpdatesOnAccessTokenChange_m7E35B38EDDDF18DE2B0B960DA8269D277C8FBCAB) ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

My setup:

Unity Editor Version: 2020.1.11
Unity SDK Version: 9.1.0
Installation Platform & Verison: [iOS] version 14.4.2
XCode: 12.4

I haven't tried the above suggestions, yet.

For now, you can comment the line below in the "Facebook.Unity.IOS.cpp" file

reinterpret_cast(IOSFBEnableProfileUpdatesOnAccessTokenChange)(static_cast<int32_t>(___enable0));

to make it build successfully, but it's NOT the best and final solution.
it's a definitely temporary solution, someone has a better answer?

I tried this and I was able to build!

For now, you can comment the line below in the "Facebook.Unity.IOS.cpp" file
reinterpret_cast(IOSFBEnableProfileUpdatesOnAccessTokenChange)(static_cast<int32_t>(___enable0));
to make it build successfully, but it's NOT the best and final solution.
it's a definitely temporary solution, someone has a better answer?

I tried this and I was able to build!

@firatagdas's solution works for me too.

It also fails using Unity 2019.4.31

It also fails using Unity 2020.1.16f1

looks to fail on any and all Unity versions, @firatagdas solution works perfect got builds out using that to compile with no issues so far. Does seem pretty impressive they released a sdk that does not even compile on a platform.

Sorry Facebook but you are amateurs. Are you even trying to build live projects with you SDK? And the bug report is here for 7 days... What about hotfix?

Subscribed for official solution.

@firatagdas, His solution worked for me as well.

Any news about this issue? I manage to fix with @zhengwu119 suggestion, but I need a fix to be able to build with cloud build please.

Put following code before the } at the end of FBUnityInterface.mm file located in FacebookSDK/SDK/Editor/iOS

  void IOSFBEnableProfileUpdatesOnAccessTokenChange(bool enable)
  {
    [[FBUnityInterface sharedInstance] IOSFBEnableProfileUpdatesOnAccessTokenChange:enable];
  }

Thanks. It's helped me.

@firatagdas 's solution worked for me with 2019.4.24, thank you @firatagdas 💯

another one for @firatagdas here. Facebook SDK 9.1.0 with Unity 2019.4.11f1. Good stuff my dude

Thanks to @firatagdas. Proposed solution (see below) works for my use case. The FB team can take care of this bug. Looks the solution is here in the comments, at least for some use cases. The fix seems to be pretty simple -> should be easy to release bug fix.

void IOSFBEnableProfileUpdatesOnAccessTokenChange(bool enable)
  {
    [[FBUnityInterface sharedInstance] IOSFBEnableProfileUpdatesOnAccessTokenChange:enable];
  }

This means that they do not even try to build for iOS really - but yeah, @firatagdas fix worked for me as well. Not sure if I should feel safe enough to actually put this on our next release though...

Same issue with Unity 2021.1.0f1 and Facebook 9.1.0

Facebook SDK team should hire @firatagdas to get things moving.

@firatagdas solution worked for us on Unity 2019.4.13f1. Thanks a lot mate.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

michelleran picture michelleran  ·  6Comments

charanjeet5ingh picture charanjeet5ingh  ·  6Comments

Shaitan1805 picture Shaitan1805  ·  6Comments

manofspirit picture manofspirit  ·  6Comments

bblpny picture bblpny  ·  4Comments