Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using cocoaPods for google AdMob SDK

Today I was trying to update GoogleAdMob SDK to 6.12, So while reading documentation I found that google recommends to use cocoaPods to manage dependencies.I deleted by previous 6.10 SDK files from my project and did as below.

So I installed cocoaPods on my machine, and followed the steps given in the adMob docs

After installing the pod, I got this message from terminal

Installing Google-Mobile-Ads-SDK (6.12.0)
Generating Pods project
Integrating client project

[!] From now on use `abc.xcworkspace`.

[!] The use of implicit sources has been deprecated. To continue using all of the sources currently on your machine, add the following to the top of your Podfile:

    source 'https://github.com/CocoaPods/Specs.git'


[!] The `abc [Debug]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

[!] The `abc [Release]` target overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation
    - Use the `$(inherited)` flag, or
    - Remove the build settings from the target.

My first doubt What does these warning means and how to resolve this?

Secondly

I opened abc.xcworkspace as suggested by cocoaPods, I could see two projects now as screen shot below

enter image description here

Here in the image you can see all frameworks are in red. So is that an issue or its fine?

Lastly my code which was working before using cocoaPods

m_googleAdView.frame = CGRectMake(0.0, 918.0, kGADAdSizeBanner.size.width,kGADAdSizeBanner.size.height);
[m_googleAdView loadRequest:[GADRequest request]];

My code for adding bannerView is already coded, But I get these errors now

Undefined symbols for architecture armv7:
  "_kGADAdSizeBanner", referenced from:
      -[AllViewController viewDidLoad] in AllViewController.o
  "_OBJC_CLASS_$_GADRequest", referenced from:
      objc-class-ref in AllViewController.o
      objc-class-ref in PageViewController.o     
  "_OBJC_CLASS_$_GADBannerView", referenced from:
      objc-class-ref in AllViewController.o
      objc-class-ref in PageViewController.o      
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
like image 274
Ranjit Avatar asked Sep 29 '14 14:09

Ranjit


People also ask

Does Google AdMob work on iOS?

In future, if you already have an app on the App Store, you can let AdMob retrieve your app information. Set the app name to GoogleAdMobDemo and choose iOS for the platform option. Click Add to proceed to the next step. AdMob will then generate an App ID for the app.

What is difference between AdMob and Ad Manager?

You can serve high-quality ads from all three platforms. Ad Manager is a different product to AdSense and AdMob. Ad Manager is a unified platform with granular inventory controls and other features that allow you to manage direct sales, third-party networks, and programmatic demand across desktop, mobile web and apps.


2 Answers

You need to add:

$(inherited)

to OTHER_LDFLAGS in your projects build settings tab

enter image description here

like image 98
Andrei Shender Avatar answered Oct 22 '22 04:10

Andrei Shender


As an alternative you can do this:

- Remove the build settings from the target.

Go to your project, over Other Linker flags (@Andrei's picture above) and press delete. It will delete your settings a write the inherited ones from the pods build settings.

Do not do this if you have additional flags...

@Ranjit: For this issue:

[!] The use of implicit sources has been deprecated. To continue using all of the sources currently on your machine, add the following to the top of your Podfile:

Just add this line

source 'https://github.com/CocoaPods/Specs.git'

At the top of your podfile, as it says ...

like image 34
LightMan Avatar answered Oct 22 '22 05:10

LightMan