Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Admob SDK - iOS -File not found

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

like image 644
slysid Avatar asked Feb 17 '15 22:02

slysid


3 Answers

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

#import <GoogleMobileAds/GoogleMobileAds.h>
like image 86
Daniel Storm Avatar answered Oct 06 '22 08:10

Daniel Storm


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

like image 23
Roei Nadam Avatar answered Oct 06 '22 07:10

Roei Nadam


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.

like image 28
Sars Avatar answered Oct 06 '22 07:10

Sars