androidunity-game-engineapplovin

Add specific library from android SDK to unity project


I'm trying to add Applovin Ads to the unity project and there is a new required to add play service sdks

Add Google Play Services to your App

Due to new requirements by Google, you'll need to integrate the Google Play Services SDK into your app.

This is mandatory; without Google Play Services, the SDK cannot function.

when I contact applovin, they ask me to add this library to my project

com.google.android.gms:play-services-games

how can I do it? I'm not using an android studio, export directly from the unity engine.


Solution

  • answer from applovin

    If you aren't already using a custom mainTemplate.gradle, you can enable it in the Android PlayerSettings under Publishing>Custom Main Gradle Template. Add this line to your mainTemplate.gradle file:

    implementation 'com.google.android.gms:play-services-ads-identifier:16.0.0'
    

    Example:

    dependencies {
        implementation fileTree(dir: 'libs', include: ['*.jar'])
        implementation 'com.google.android.gms:play-services-ads-identifier:16.0.0'
    **DEPS**}
    

    these steps work for any SDK implementations, Consider yourself inside Gradle file.