Search code examples
iosxcodeadmobcocoapodsfacebook-audience-network

iOS app with FBAudienceNetwork on AdMob mediation: error "No such module FBAudienceNetwork"


I am trying to configure FB Audience Network with AdMob mediation on iOS, using Cocoapods, but I get a strange error:

No such module 'FBAudienceNetwork'

enter image description here

This is what I placed in the podfile:

pod 'Google-Mobile-Ads-SDK'
pod 'FBAudienceNetwork'
pod 'GoogleMobileAdsMediationFacebook'

I tried to clean the build folder and to restart Xcode, but I still get the same error.

Any suggestion of what I should do?


Solution

  • It seems like you followed the steps correctly. A lot of the time, this issue might come up due to some other dependencies or conflicting files. Ways to debug:

    • Run pod update.
    • Run sudo gem install cocoapods to get the latest cocapods version and run pod update.
    • Clean install, remove all the pod dependencies in the Podfile, and run pod install. Put the dependencies back and run pod install again to get a clean install.
    • Similar to the above but the difference is that you install each pod individually.

    Hope it helps.

    If you are ever in the market to track your ads or get resources on how to set up some ads have a look at Motics or Resources.