Apple Mach-O Librarian Error when include AdMob SDK



When I followed google AdMob instruction, and finish all required steps.
when compile my project, i got following error:

/Applications/ -dynamic not specified the following flags are invalid: -ObjC
/Applications/ can’t locate file for: -lwebp
/Applications/ file: -lwebp is not an object file (not allowed in a library)
Command /Applications/ failed with exit code 1


Command /Applications/ failed with exit code 1

have searched for whole night and couldn’t solve this problem. Any ideas?


anyone to help?


ok… Finally i solved the problem.

Now I have included admob and added following code to rootviewcontroller:

#import <UIKit/UIKit.h>
#import “GADBannerView.h”

@interface RootViewController : UIViewController {

GADBannerView *bannerView_;



  • (void)viewDidLoad {
    [super viewDidLoad];

    // Create a view of the standard size at the top of the screen.
    // Available AdSize constants are explained in GADAdSize.h.
    // Create a view of the standard size.
    bannerView_ = [[GADBannerView alloc]

    // Specify the ad unit ID.
    bannerView_.adUnitID = @“ca-app-pub-4106+hidemyid+sorry”;

    // Let the runtime know which UIViewController to restore after taking
    // the user wherever the ad goes and add it to the view hierarchy.
    bannerView_.rootViewController = self;
    [self.view addSubview:bannerView_];

    // Initiate a generic request to load it with an ad.
    [bannerView_ loadRequest:[GADRequest request]];

when I run my project, I didn’t see the banner.

I am using cocos2d-x javascript to code.

do I have to call the API in my scene javascript files? if so, how to call it?


anyone kindly advise why does this happen?