larsacus / LARSAdController

Lightweight ad mediation for iOS to properly manage multiple ad networks dynamically including iAd and Google ads.
http://theonlylars.com/blog/2013/01/10/stupid-easy-ads-with-larsadcontroller-3-dot-0/
MIT License
269 stars 60 forks source link

Build Error: 'GADBannerViewDelegate.h" not found #122

Open robmontesinos opened 8 years ago

robmontesinos commented 8 years ago

I found the file in GoogleMobileAds.framework/Headers in CocoaPods. It looks like Google changed the way it's doing things. Will this affect the library in other ways? Thank you Lars

Xcode 7.0.1 - iOS 9.0

robmontesinos commented 8 years ago

I fixed it by editing TOLAdapterAdMobAds.h

#import <GoogleMobileAds/GADBannerViewDelegate.h>
#import <GoogleMobileAds/GADBannerView.h>

//#import "GADBannerViewDelegate.h"
//#import "GADBannerView.h"
larsacus commented 8 years ago

I've actually been looking at this. I started earlier this week in commit 987064e, but ran into a couple other things that I hope to get to this weekend. Google doesn't make these things very easy to future-proof...

robmontesinos commented 8 years ago

@larsacus you're absolutely right about that. And just in case you didn't know, you are the quickest responder that I have seen on GitHub. Salud!

larsacus commented 8 years ago

It's probably because I'm always online :smile:

dafdafydd commented 8 years ago

Hello, I've just encountered something strange with that. I followed the instructions above (I modified TOLAdAdapterGoogleAds.h and not TOLAdapterAdMobAds.h - is that correct?) but now I get "Declaration of 'GADBannerViewDelegate' must be imported from module 'GoogleMobileAds' before it is required. Do you have any idea how to deal with it?

larsacus commented 8 years ago

@dafdafydd No, that's not correct. Those are two completely different files meant for different ad systems -- one is for Google Ads and the other is for  iAds.

dafdafydd commented 8 years ago

But I mean AdMobAds.h and not iAds.h.

larsacus commented 8 years ago

I'm not sure I follow. There has never been a file named TOLAdAdapterAdMobAds.h.

dafdafydd commented 8 years ago

I thinks so too but this is the name @robmontesinos used:) I just wanted to make sure that I am not missing some files or something.

Do you have an idea why the error might appear? Your example code compiles without problems while my does not.

larsacus commented 8 years ago

There's currently an issue when using this library with CocoaPods. Google in all their infinite wisdom has changed the deployment method of their library without revving the major version, which has made supporting this change extremely difficult. I still haven't found a workaround for it except for to 1. Remove support for CocoaPods or 2. Remove support for GoogleAds when using CocoaPods and just use something like Carthage to bring in the frameworks.

dafdafydd commented 8 years ago

I see. I will stick to 3.0 and AdMob 6.0 for now then. Thank you for your response and your hard work. I hope you are finally going to find a solution as your library is so convenient and elegant that it would be great loss to remove support for CocoaPods.