slysid slysid - 4 months ago 23
iOS Question

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

Answer

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

#import <GoogleMobileAds/GoogleMobileAds.h>