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:
Add the JitPack and IS repositories to your build file. Add it in your root
build.gradle
at the top of your repositories:
maven { url 'https://jitpack.io' }
maven { url 'https://android-sdk.is.com/' }
After adding the above code to your repositories inside build.gradle
it should look similar to this:
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:
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.
Add the dependency
dependencies {
implementation 'com.github.ArcPlayAi:arcplay-sdk-android:2.0.+'
}
That's it! Build the codebase and verify it is successful. Now you can move on to the Initialization step.
NOTE: If you are using Progaurd, kindly follow these rules.
Manual Integration
Alternatively, you can do the manual integration by following the below steps:
Download the SDK:
Download the
arcSDK.aar
from the secure link shared by ArcPlay customer success team.Place the
arcSDK.aar
file to thelibs
directory of your project or any other directory of your choice.
Modify
build.gradle
and verify app:Open
build.gradle
file from the app module.Add the following line of code to the
dependencies
blockClick on
Sync Now
from the Android Studio bar and build the project to ensure that SDK is integrated correctly without errors.
//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'
ADDITIONAL NOTES:
Progaurd rules
Create a file name with
proguard-arcplay.pro
Add the following code in
proguard-arcplay.pro
file-keep class com.arcplay.android.** {*;} -keep class kotlinx.coroutines.** { *; } -keep class retrofit2.** { *; } -keep class okhttp3.** { *; } -dontwarn com.google.android.gms.ads.** -dontwarn com.applovin.** -dontwarn com.ironsource.mediationsdk.**
Include the following line of code in your
build.gradle
file before generating the release apkrelease { proguardFile 'proguard/proguard-arcplay.pro' }
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 team for further assistance.
Last updated