Facebook-sdk-for-unity: Error when building facebook sdk (7.16.0) on iOS with xcode 10.1

Created on 7 Jun 2019  ·  11Comments  ·  Source: facebook/facebook-sdk-for-unity

FBUnityInterface.mm:472:47: Cannot initialize a parameter of type 'BOOL' (aka 'signed char') with an rvalue of type 'NSNumber * _Nonnull'
FBUnityInterface.mm:477:53: Cannot initialize a parameter of type 'BOOL' (aka 'signed char') with an rvalue of type 'NSNumber * _Nonnull'

Most helpful comment

I changed this part of the code from this:

void IOSFBAutoLogAppEventsEnabled(BOOL autoLogAppEventsEnabledID)
  {
    [FBSDKSettings setAutoLogAppEventsEnabled:[NSNumber numberWithBool:autoLogAppEventsEnabledID]];
  }

  void IOSFBAdvertiserIDCollectionEnabled(BOOL advertiserIDCollectionEnabledID)
  {
    [FBSDKSettings setAdvertiserIDCollectionEnabled:[NSNumber numberWithBool:advertiserIDCollectionEnabledID]];
  }

to this:

void IOSFBAutoLogAppEventsEnabled(BOOL autoLogAppEventsEnabledID)
  {
    [FBSDKSettings setAutoLogAppEventsEnabled:autoLogAppEventsEnabledID];
  }

  void IOSFBAdvertiserIDCollectionEnabled(BOOL advertiserIDCollectionEnabledID)
  {
    [FBSDKSettings setAdvertiserIDCollectionEnabled:advertiserIDCollectionEnabledID];
  }

And it worked for me.

All 11 comments

Not sure what the NSNumber use for in these method but parsing BOOL value without NSNumber make the build succcess.

Building success but the codeless api return null reference when using callback from facebook interface
6/7/19, 10:04:14 AM baccarat414[762]: System.NullReferenceException: Object reference not set to an instance of an object.
at Facebook.Unity.CodelessUIInteractEvent.Update () [0x00000] in <00000000000000000000000000000000>:0
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
UnityEngine.Logger:Log(LogType, Object)
UnityEngine.Debug:Log(Object)
Facebook.Unity.CodelessUIInteractEvent:Update()

(Filename: /Users/builduser/buildslave/unity/build/Runtime/Export/Debug.bindings.h Line: 43)

I have the exact same issue,build successful and tested it on iphone, but archive fails.

i didn't know what the issue was with 7.16.0 but i switched back to 7.15.1 and it was fine

I have the same error using the same configuration. I have noticed that it's building in debug mode but not in release. What could go wrong ?

I have the same error. download package in official website.please fix it. thanks

The same error here. Any solutions?

I changed this part of the code from this:

void IOSFBAutoLogAppEventsEnabled(BOOL autoLogAppEventsEnabledID)
  {
    [FBSDKSettings setAutoLogAppEventsEnabled:[NSNumber numberWithBool:autoLogAppEventsEnabledID]];
  }

  void IOSFBAdvertiserIDCollectionEnabled(BOOL advertiserIDCollectionEnabledID)
  {
    [FBSDKSettings setAdvertiserIDCollectionEnabled:[NSNumber numberWithBool:advertiserIDCollectionEnabledID]];
  }

to this:

void IOSFBAutoLogAppEventsEnabled(BOOL autoLogAppEventsEnabledID)
  {
    [FBSDKSettings setAutoLogAppEventsEnabled:autoLogAppEventsEnabledID];
  }

  void IOSFBAdvertiserIDCollectionEnabled(BOOL advertiserIDCollectionEnabledID)
  {
    [FBSDKSettings setAdvertiserIDCollectionEnabled:advertiserIDCollectionEnabledID];
  }

And it worked for me.

@PacPalCent Thanks! Its work for me.

The issue should be fixed in v7.16.1

In debug mode still showing error, even in iPhone build

Was this page helpful?
0 / 5 - 0 ratings