Ranjit
Ranjit

Reputation: 4646

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)

Upvotes: 16

Views: 6911

Answers (2)

LightMan
LightMan

Reputation: 3575

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 ...

Upvotes: 9

Andrei Shender
Andrei Shender

Reputation: 2497

You need to add:

$(inherited)

to OTHER_LDFLAGS in your projects build settings tab

enter image description here

Upvotes: 54

Related Questions