# Gradle

## Maven (recommended)

Maven allows the integration of the lightweight ArcPlay.ai SDK (\~150 KB) by adding a few lines of code to the application’s `build.gradle` file. To use ArcPlay.ai simply add it to your `build.gradle` file:

1. Add the JitPack and IS repositories to your build file. Add it in your root `build.gradle` at the top of your repositories:

{% code overflow="wrap" %}

```gradle
maven { url 'https://jitpack.io' }
⁠maven { url 'https://android-sdk.is.com/' } ⁠		
```

{% endcode %}

After adding the above code to your repositories inside `build.gradle` it should look similar to this:

```gradle
repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' }
    ⁠maven { url 'https://android-sdk.is.com/' } ⁠
}
```

In case, you don't have `mavenCentral()` in your repositories, you should also add the following maven repos before jitpack:

```gradle
repositories {
    maven { url 'http://repo1.maven.org/maven2' }
    maven { url 'https://jitpack.io' }
    ⁠maven { url 'https://android-sdk.is.com/' } ⁠
}
```

**Note:** If you are facing issues with fetching dependencies for `com.github.ArcPlayAi:arcplay-sdk-android`, you should add the above maven repo to your repositories.

2. Add the dependency

{% code overflow="wrap" %}

```gradle
dependencies {
    implementation 'com.github.ArcPlayAi:arcplay-sdk-android:2.0.+'
}
```

{% endcode %}

That's it! Build the codebase and verify it is successful. Now you can move on to the [Initialization step](/knowledge-portal/for-consumer-apps/rewarded-h5-games/engineering-team/sdk-integration/android/initialize.md).&#x20;

**NOTE:** If you are using Progaurd, kindly [follow these rules](#additional-notes).

## Manual Integration

Alternatively, you can do the manual integration by following the below steps:

1. **Download the SDK:**
   * Download the `arcSDK.aar` from the secure link shared by [ArcPlay customer success](/knowledge-portal/knowledge-portal/contact-details/customer-success.md) team.
   * Place the `arcSDK.aar` file to the `libs` directory of your project or any other directory of your choice.
2. **Modify `build.gradle` and verify app:**
   * Open `build.gradle` file from the app module.
   * Add the following line of code to the `dependencies` block
   * Click on `Sync Now` from the  Android Studio bar and build the project to ensure that SDK is integrated correctly without errors.

{% code overflow="wrap" fullWidth="false" %}

```gradle
//SDK file
implementation files('lib/arcSDK.aar')

//Dependencies required
implementation 'com.jakewharton.retrofit:retrofit2-kotlin-coroutines-adapter:0.9.2'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.1'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.amplitude:android-sdk:2.40.1'
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'io.sentry:sentry-android-core:6.34.0'
implementation 'com.google.android.gms:play-services-ads-identifier:18.1.0'
```

{% endcode %}

#### ADDITIONAL NOTES:

1. Progaurd rules
   1. Create a file name with `proguard-arcplay.pro`
   2. Add the following code in `proguard-arcplay.pro` file
      1. <pre><code><strong>-keep class com.arcplay.android.** {*;}
         </strong>-keep class kotlinx.coroutines.** { *; }
         -keep class retrofit2.** { *; }
         -keep class okhttp3.** { *; }
         -dontwarn com.google.android.gms.ads.**
         -dontwarn com.applovin.**
         -dontwarn com.ironsource.mediationsdk.**
         </code></pre>
   3. Include the following line of code in your `build.gradle` file before generating the release apk
      1. ```
         release { proguardFile 'proguard/proguard-arcplay.pro' }
         ```
2. If you are using a build system other than Gradle, or if you encounter any issues during the integration process, kindly contact the [ArcPlay.ai customer success](/knowledge-portal/knowledge-portal/contact-details/customer-success.md) team for further assistance.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://arcplay-ai.gitbook.io/knowledge-portal/for-consumer-apps/rewarded-h5-games/engineering-team/sdk-integration/android/gradle.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
