11

I have installed Google Analytics and Google AdMob SDK in my iOS project using Cocoapods. I have implemented both the functionalities in my app and everything looked okay for a week. Then suddenly, when I compiled the app, I received this error message:

"GADBannerView.h file not found". in "#import GADBannerView.h"

But I was able to see the header GADBannerView.h in my project under Pods target.

I did some research and found this error can happen due to SEARCH PATH in BUILD SETTINGS. Many faced similar issues when they moved the project from one machine to another machine but I didn't do that. So, instead of investigating on SEARCH PATH, I removed my GADBanner implementation from my project and commented line #import GADBannerView.h and my project compiled successfully.

I don't quite understand why the Google Analytics SDK is getting compiled successfully while AdMob is throwing a compilation error. I even did a pod update and still received the same error.

The SEARCH PATHS in my target is $(inherited) and ALWAYS SEARCH USER PATH is set to No

4 Answers 4

28

Starting at AdMob 7.0, AdMob has made the SDK a framework. Import it like so:

#import <GoogleMobileAds/GoogleMobileAds.h>
0
3

Go to: --> Build Settings --> Apple LLVM 7.1 - Language - Modules --> Enable Modules (C and Objective-C) --> set it to Yes.

1

According to the Google Ads Developer Blog we need to use:

@import GoogleMobileAds;

If you have a problem with the @import syntax you need to modify your project build settings. Search for Modules and set Enable Modules to YES.

-1

First one is issue of latest SDK will not be used for Admob. second is issue of Xcode 7.0 and you can try in Xcode xcode below 7 for till date,

Not the answer you're looking for? Browse other questions tagged or ask your own question.