No such module 'FBAudienceNetwork' in XCode 9 Swift 4

3.9k Views Asked by At

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?

6

There are 6 best solutions below

0
Andrew On BEST ANSWER

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.

0
weizenberg On

Following this post: https://developers.facebook.com/bugs/185968218614056/ and after downgrade to version 4.23 (supported by MoPub mediation as written here: https://github.com/mopub/mopub-ios-sdk/wiki/Integrating-Native-Third-Party-Ad-Networks) the integration is working (by adding the framework manually).

This is a bug in 4.26 version, so anyone that encourage the same issue, you have to wait for Facebook fixing this bug. I recommend to subscribe and follow the discussion I posted.

0
tylermilner On

I'm also seeing the same problem. I'm watching the Facebook bug report, but it's already been closed so I don't have high hopes of it being fixed anytime soon. Facebook suggested adding "$(SRCROOT)" to your Framework Search Paths as a work around, but it didn't work for me.

For now, I've manually locked my "FBAudienceNetwork" pod to version 4.25.0 with the following line in my Podfile:

pod 'FBAudienceNetwork', '4.25.0'
1
AudioBubble On

Try this solution it will fix your issue. You need to rename FBAudienceNetwork.modulemap to module.modulemap in FBAudienceNetwork.framework/Modules folder. v4.26

0
Ittai Oren On

From the audience network installation guide

enter image description here

Good luck

0
Eran Talmor On

It works when I'm using only the framework within the "static" folder.