Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AdMob 7.3.1 and Swift 2.0 - Module not found

I have a problem using the Google AdMob Framework with Swift 2.0. I'm using AdMob for the first time so I do not know if the problem is with AdMob or Swift 2.0.

I have included the AdMob Framework and import it like that in my ViewController:

import GoogleMobileAds

The error I am getting is:

No such Module GoogleMobileAds

A bridging header is also not working:

#import <GoogleMobileAds/GoogleMobileAds.h>

The Error:

GoogleMobileAds/GoogleMobileAds.h file not found

How should I include AdMob? I have tested AdMob 6.12.2 and included it via the bridging header and it works.

The previous posts from other users didn't help me - there were no solutions for this problem.

like image 593
Kevin Lieser Avatar asked Jun 16 '15 19:06

Kevin Lieser


2 Answers

Right click your project -> Show in Finder -> Create New Folder and copy GoogleMobileAds.framework after open project.

Select project-> Targets -> Build Phases -> Link Binary With Libraries -> click "+" button -> click Add other.. button -> select GoogleMobileAds.framework and click Open button.

Restart your app then compile and import GoogleMobileAds to your swift view controller

like image 185
ethemsulan Avatar answered Nov 09 '22 19:11

ethemsulan


There are two steps to solve your problem:

  1. Put the path of GoogleMobileAds.framework in Targets -> Build Settings "Framework Search Path"

  2. Set "No" under Project -> Build Settings -> Enable Bitcode

like image 10
Jindu Chen Avatar answered Nov 09 '22 21:11

Jindu Chen