title: Could not find custom event class named MPGoogleAdMobBannerCustomEvent
body: <p>I am having trouble integrating the AdMob SDK into MoPub (in Fabric).  I installed MoPub through the fabric installer. I am using iOS with Swift, XCode Version 7.3.1 (7D1014), base SDK iOS 9.3, project deployment target iOS 8.0. </p>
  
  <p>I am able to display the MoPub test ads in my app but I get runtime errors when displaying the AdMob ads through MoPub.</p>
  
  <p>I cannot find detailed instructions on how to integrate the AdMob SDK when using the Fabric MoPub installer.  Only instructions to add third party libraries when using the standalone MoPub SDK.  I would like to keep the Fabric MoPub framework.</p>
  
  <p>After I got the MoPub test ads working, I followed these steps:</p>
  
  <ol>
  <li><p>I added the GoogleAdMobCustomEvent.framework into the project, that came in the mopub-ios-custom-events.zip archive (found in <a href="https://dev.twitter.com/mopub/ios/mediation-fabric" rel="nofollow">https://dev.twitter.com/mopub/ios/mediation-fabric</a>)</p></li>
  <li><p>I added the GoogleMobileAds.framework (latest version from Google: v7.8.1) to the project.</p></li>
  <li><p>In the MoPub dashboard, I created a new Order, with one Line Item and 2 ad units (banner and leaderboard) with the AdMob network.</p></li>
  <li><p>When I run the project I get the following error:</p>
  
  <pre><code>2016-05-28 12:03:57.662 moPubTest[43756:2148130] MOPUB: Banner view (*adunit id*) loading ad with MoPub server URL: *MoPub server URL*
  2016-05-28 12:04:00.909 moPubTest[43756:2148130] MOPUB: Could not find custom event class named MPGoogleAdMobBannerCustomEvent
  2016-05-28 12:04:00.910 moPubTest[43756:2148130] MOPUB: Banner ad view is fetching ad network type: admob_native
  2016-05-28 12:04:00.910 moPubTest[43756:2148130] MOPUB: Banner view (*adunit id*) loading ad with MoPub server URL: *MoPub server URL*
  2016-05-28 12:04:00.954 moPubTest[43756:2148130] MOPUB: Banner ad view is fetching ad network type: clear
  2016-05-28 12:04:00.954 moPubTest[43756:2148130] MOPUB: No ads found for ad unit: *adunit id*
  2016-05-28 12:04:02.365 moPubTest[43756:2148130] MOPUB: Banner view (*adunit id*) failed. Error: Error Domain=com.mopub.iossdk Code=0 "The operation couldn’t be completed. (com.mopub.iossdk error 0.)"
  </code></pre></li>
  </ol>
  
  <p>It looks like I am missing a step. I am guessing the issue is when integrating the MoPub provided GoogleAdMobCustomEvent.framework (which is in Objective-C, and contains the MPGoogleAdMobBannerCustomEvent header) into my Swift project.</p>
  
  <p>I've tried adding the frameworks to the project both by dragging and adding the files (selecting the copy files option). I also tried adding framework and header search paths, added a bridging header file, changed paths inside framework header files.</p>
  
  <p>In all of the above the project compiles without errors but I still get the error at runtime: <strong>Could not find custom event class named MPGoogleAdMobBannerCustomEvent</strong></p>
  
  <p>Anyone ideas on what could be wrong?</p>
  
  <p>Thanks!</p>
  
  <p>UPDATE:
  I was able to get this to work by switching the Fabric and MoPub frameworks to be installed via CocoaPods (instead of using the Fabric app):</p>
  
  <ol>
  <li><p>Installed Fabric and Mopub via CocoaPods
  <a href="https://fabric.io/kits/ios/mopub/install" rel="nofollow">https://fabric.io/kits/ios/mopub/install</a></p></li>
  <li><p>Instead of adding the GoogleAdMobCustomEvent.framework, I added the following Objective-C files manually to the project:</p>
  
  <p>MPGoogleAdMobBannerCustomEvent.h<br>
  MPGoogleAdMobBannerCustomEvent.m<br>
  MPGoogleAdMobInterstitialCustomEvent.h<br>
  MPGoogleAdMobInterstitialCustomEvent.m</p>
  
  <p>These 4 files can be found in the AdNetworkSupport folder of the ios mopub SDK git repo</p></li>
  <li><p>Created a bridging header file with the following content:</p>
  
  <pre><code>#import &lt;mopub_ios_sdk/MoPub-Bridging-Header.h&gt;
  #import &lt;GoogleMobileAds/GoogleMobileAds.h&gt;
  </code></pre></li>
  <li><p>I added the GoogleMobileAds.framework (latest version from Google: v7.8.1) to the project.</p></li>
  <li><p>Added the path to the location of GoogleMobileAds.framework/Headers in the Targets' "Search Paths" -> "Framework Search Path"</p></li>
  </ol>
  
  <p>In theory you can also install MoPub's custom events via CocoaPads, but at the moment it is not possible because of a bug. (see <a href="https://stackoverflow.com/a/36830967/6394927">https://stackoverflow.com/a/36830967/6394927</a>)</p>
  
  <p>I hope this helps someone else in the future.</p>