Google Ads.nbc in MOE 1.3 Admob

Hi all,

I want to add admob to my game (which create by Libgdx) but I can’t found guide for admob with MOE 1.3, I create New Binding from MOE but that have errors as : fatal error: ‘GoogleMobileAds/GADAdSize.h’ file not found
How I can fix it, please?

Here is error

I was just doing this myself! :grinning:

Please see this thread: Help with the "Create New Binding" option in 1.3.x plugin

Try changing the import statements in the framework file to just fileName.h instead of GoogleMobileAds/fileName.h

Thanks Chandu JR,
I change fileName.h by GoogleMobileAds/fileName.h but still same error. Where file .nbc of you!

google-ads.nbc (872 Bytes)
my file .nbc

I had posted a screenshot of my nbc file in that thread. Also, please check whether the error is referring to the same file. You may have to change all the import statements.

I change as you. But error still.

You didn’t change all the imports. This is exactly what I said, both the errors are different files. The Multi-OS Engine window at the bottom of the IDE will show which file is having the problem. Just click on it and change the import statement of all files that have these errors.

Chandu JR

Thanks! I fix it now and no error!

Hi Chandu JR!

How to add Intersitial and Banner Ads in code of MOE?

Hi,

Could you please share your binding project with us, so we can understand what could be the problem? We don’t see such issues with package names and output folders.

Best Regards,
Gergely

I add GoogAdmob.nbc ok. But when i build moe that error
WARNING: Binding class refers to class GADInterstitial, but it can not be found. Fallback to indirect super class.
2017-05-10 22:37:11.454 Dragon[1644:41946] -[NSObject initWithAdUnitID:]: unrecognized selector sent to instance 0x7b6b3b40
org.moe.natj.objc.ObjCException: -[NSObject initWithAdUnitID:]: unrecognized selector sent to instance 0x7b6b3b40
at apple.uikit.c.UIKit.UIApplicationMain(Native Method)
at star.com.game.IOSMoeLauncher.main(IOSMoeLauncher.java:88)

How I can fix it! Any one has guide full for ads bindings moe? Thanks!

We just updated the official moe-bindings repository with 3 Google libraries: maps, maps-ios-utils and mobile-ads. We had no problem generating it with the Framework setting.

Could you take a look to see if it works for you?

Best Regards,
Gergely

Make sure you’ve added the -ObjC linker flags in Xcode. Open your Xcode project and go to Build Settings > Linker Flags > Other Linker Flags and add it to both Debug and Release. Double click the current settings and click the + button and just type -ObjC and press Enter.

I added -ObjC in Other Linker Flags to Debug and Release. But error still!

Thanks! I will check it!

I follow you, generating ok but when use GADBannerView error
Binding class refers to class GADBannerView, but it can not be found. Fallback to indirect super class.
2017-05-11 11:23:35.360 Dragon[3443:90249] -[UIView initWithAdSize:]: unrecognized selector sent to instance 0x7af6e390
org.moe.natj.objc.ObjCException: -[UIView initWithAdSize:]: unrecognized selector sent to instance 0x7af6e390
at apple.uikit.c.UIKit.UIApplicationMain(Native Method)
at com.game.IOSMoeLauncher.main(IOSMoeLauncher.java:37)
You added ads view in project?