Show Ads admob in ios?

I’m a newbie in MOE, i try to add ads admob in my game (use Libgdx). When i generate New Bindings every look OK. But when I use GADBannerView in code that have 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)

I add flag -ObjC in Other Linker Flags to Debug and Release. But error still!
How do I can fix it, please? Why do we have any video in Youtube support that? When i fix it, i will upload video.

Hi,

The moe-bindings project includes a sample app as well, you should be able to try it out there.
Also, please post your project (or a simplified test project that shows the problem), so we can better help you.

Best Regards,
Gergely

Hi,

Here is link of my code. I don’t know why?

https://drive.google.com/open?id=0B5LTybD9a9lzM0FuczRjVGpFb1k

One thing I noticed from LibGDX is that since the iOS module isn’t the root level of the project, some things act strangely. One of them is the proguard.append.cfg gets generated out of place and doesn’t get recognized because of that.

In the build.gradle for your iOS module, you probably have something like

def proguard = file("proguard.append.cfg")
if (!proguard.exists()) {
    proguard = new File("proguard.append.cfg")
    proguard << "\n-keep class com.badlogic.** { *; }\n"
    proguard << "-keep enum com.badlogic.** { *; }\n"
}

The problem is that new File("proguard.append.cfg") generates that file in the root project directory, which is NOT your MOE module. You’ll want to change that to something like new File("ios-moe/proguard.append.cfg") which tells it to put the file in your ios-moe module.

Then you can add proguard configurations to keep your bindings and other important classes. Hopefully that helps, took me a while to get that one sorted :relaxed:

Thanks for support!

But I think it isn’t problem. I change as your guide but nothings change. I still get error.

Hi!

I added missed frameworks to xcode project and fixed init_admob_banner method.

https://drive.google.com/file/d/0BxaA-mVsTwv5SHZTR0dTNzZKQms/view?usp=sharing

Best Regards,
Roland

Very helpfull!

Thank so much!