1
votes

I have a game in LibGDX (working perfectly in iOS with Android Studio) but without ads.

I have followed too many tutorial to add Admob, but everything than I tried got the same result:

My build.gradle file:

dependencies {
    //classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.3.3-SNAPSHOT'
    classpath 'com.mobidevelop.robovm:robovm-gradle-plugin:2.2.1-SNAPSHOT'
}

(I have tried with both 2.3.3 and 2.2.1)

ext {
    appName = "xxxxxx"
    gdxVersion = '1.9.7'
    roboVMVersion = '2.2.1-SNAPSHOT'
    robopodsVersion = '2.2.1'
    box2DLightsVersion = '1.4'
    ashleyVersion = '1.7.0'
    aiVersion = '1.8.0'
}

(I have also tested with gdxVersion 1.9.0)

And ios project dependencies

project(":ios") {
apply plugin: "java"
apply plugin: "robovm"


dependencies {
    compile project(":core")
    compile "com.mobidevelop.robovm:robovm-rt:$roboVMVersion"
    compile "com.mobidevelop.robovm:robovm-cocoatouch:$roboVMVersion"
    compile "com.badlogicgames.gdx:gdx-backend-robovm:$gdxVersion"
    compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-ios"
    compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-ios"

    compile "com.mobidevelop.robovm:robopods-google-mobile-ads-ios:$robopodsVersion"
}}

I have also added this to robovm.xml:

<frameworkPaths>
    <path>libs</path>
</frameworkPaths>

<frameworks>
    <framework>GoogleMobileAds</framework>
</frameworks>

Finally, I have added GoogleMobileAds.framework to my ios/build/libs folder

When I start to modify the IOSLauncher class by adding the BannerAdView, it throw the following error

public class IOSLauncher extends IOSApplication.Delegate {

private GADBannerView adview;

Error:

Error:(13, 13) error: cannot find symbol class GADBannerView

What am I doing wrong? Someone has had the same issue?

Thanks in advance

Pablo

2
No useful information in this Tutorial? - Jeroen Heier
Hi, thanks for your answer The think is that Im using LibGDX no Swift Native, and that Tutorial is for Swift Programming - Pablo Ariel Serra

2 Answers

1
votes

Finally, I have added GoogleMobileAds.framework to my ios/build/libs folder

You have to put GoogleMobileAds.framework folder to 'ios/libs/' folder and not to 'ios/build/libs/' folder. So you have to create a new 'libs' folder and put it in 'ios/' folder. Path for the Google Mobile Ads framework should be: "ios/libs/GoogleMobileAds.framework"

1
votes

I resolve my problem

All i had to do was Refresh all gradle project to let those libraries to download

Thanks to all!