Follow these steps to integrate MoEngage on Android:
Adding Dependency
Add mavenCentral()
repository in the project-level build.gradle
file.
buildscript {
repositories {
mavenCentral()
}
}
allprojects {
repositories {
mavenCentral()
}
}
Add the below dependency in the app/build.gradle file.
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation("androidx.core:core:1.3.1")
implementation("androidx.appcompat:appcompat:1.2.0")
implementation("androidx.lifecycle:lifecycle-process:2.2.0")
implementation("com.moengage:moe-android-sdk:11.5.00")
}
For more information about the build config and other libraries used by the MoEngage Android SDK, refer to the SDK Configuration.
We recommend integrating the MoEngage Dependency Catalog to easier dependency management. Refer to the documentation to know more.
Enable Java 8
MoEngage Android SDK version 11.0.00 and later the SDK is target and source compatible with version 8 of the Java Programming Language. Enable Java 8 in the application build.gradle
if not done already.
android {
...
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
For more information about samples, refer to Andriod Sample.
warning |
Important If your app is using AndroidX libraries, ensure that you have added the legacy-support-v4 dependency to your application only if your SDK version is equal to or lesser than 10.3.02. |