Search code examples
javajavafxadmobgluongluon-mobile

Where do i get google-play-services-ads.jar to include in my project?


I need to know where i have to get the google-play-services-ads.jar to include it in my project, so the ADMob banner can work fine.

Can everyone help me?

I'm implementing ADMob using this guide:

Gluon mobile cross-platform adsView

Thanks in advance


Solution

  • Google has a local repository where you can find Google Play Services dependencies. For ads, you can find the .aar file under:

    <ANDROID_HOME>/extras/google/m2repository/com/google/android‌​/gms/play-services-a‌​ds/<version>/play-se‌​rvices-ads-<version>‌​.aar
    

    where ANDROID_HOME has been added to the gradle.properties file, with the path to the Android SDK, and <version> should be replaced with the number of ads version, i.e. 9.4.0.

    Adding explodeAarDependencies to your build.gradle file takes care of finding that aar file, and extracting the jar and other required files, into an exploded folder:

     <ANDROID_HOME>/extras/google/m2repository/com/google/android‌​/gms/play-services-a‌​ds/<version>/exploded/play-se‌​rvices-ads-<version>‌​.jar
    

    You can find more about that task here.