(UNITY) Build error for IOS in Xcode -> -> "Lexical or Preprocessor Issue" -> 'FBSDKURLSession.h' file not found, FBSDKUserDataStore.h' file not found

Viewed 1035

The error I get when trying to build my app. I am using Xcode version: 12.3

Lexical or Preprocessor Issue:

  1. /Pods/FBSDKCoreKit_Basics/Sources/FBSDKCoreKit_Basics/FBSDKURLSession.m:19:9: fatal error: 'FBSDKURLSession.h' file not found
  2. Pods/FBSDKCoreKit_Basics/Sources/FBSDKCoreKit_Basics/FBSDKUserDataStore.m:19:9: fatal error: 'FBSDKUserDataStore.h' file not found
  3. /Pods/FBSDKCoreKit_Basics/Sources/FBSDKCoreKit_Basics/FBSDKURLSessionTask.m:19:9: fatal error: 'FBSDKURLSessionTask.h' file not found

Lexical or Preprocessor Issue Lexical or Preprocessor Issue 2

Any solution for this issue?

1 Answers

I had the same issue with Xcode 12.5 and also XCode 12.5.1. For me it was an incompatibility of FBAudienceNetwork and the FBSDK Pods.

These were the Facebook cocoa pods used in the Unity project:

pod 'FBAudienceNetwork', '6.5.1'
pod 'FBSDKCoreKit', '~> 9.0'
pod 'FBSDKGamingServicesKit', '~> 9.0'
pod 'FBSDKLoginKit', '~> 9.0'
pod 'FBSDKShareKit', '~> 9.0'

Compile errors started when I upgraded FBAudienceNetwork to 6.5.1.

The solution for me was to upgrade the Unity Facebook SDK to
11.0.0 (https://developers.facebook.com/docs/unity/downloads).

Related