swiftxcodefacebook-ios-sdkfacebook-audience-networkfacebook-ios-sdk-4.0

No such module 'FBAudienceNetwork' in XCode 9 Swift 4


I installed the FBAudienceNetwork (version 4.26.0) with CocoaPods (version 1.3.1). I followed the official manual as published at https://developers.facebook.com/docs/audience-network/ios, but the Xcode still not recognized the framework.

Just to be clear - I opened the project from xcworkspace file.

enter image description here

I tried the following steps with no success:

  1. Install the framework manually, adding the ~/Documents/FacebookSDK path to Framework Search Path
  2. Make sure that the pods project compiled using Swift 4
  3. Added also FBSDKCoreKit (with Bolts) and FBSDKShareKit (both frameworks imported successfully)
  4. Clean the project, delete DerivedData and also clean the pods cache and reinstalling the pods

Nothing worked so far. Anyone faced the same issue and know the reason?


Solution

  • Fixed in v4.27.0

    Another solution that uses latest SDK (until Facebook fixes this) is to add a line to your Objc bridging header:

    #import <FBAudienceNetwork/FBAudienceNetwork.h>
    

    Of course this assumes you are using a bridging header, and if you're not then you could add one but that defeats the point of using modules. Hopefully Facebook fixes this soon.