Android

Set up repositories

Add the mavenCentral() repository in the project-level build.gradle file.

build.gradle
buildscript {
    repositories {
        mavenCentral()
    }
}
allprojects {
    repositories {
        mavenCentral()
    }
}

Add dependencies

Add the following dependencies in the android/app/build.gradle file.

Add MoEngage Library

build.gradle
dependencies {
    ...
implementation("com.moengage:moe-android-sdk:$sdk-version")
}

replace $sdkVersion with the appropriate SDK version

Add Androidx Libraries

The SDK depends on a few Androidx libraries for its functioning, add the below Androidx libraries in your application if not done already.

build.gradle
dependencies {
    ...
implementation("androidx.core:core:1.6.0")
implementation("androidx.appcompat:appcompat:1.3.1")
implementation("androidx.lifecycle:lifecycle-process:2.7.0")
}

The MoEngage SDK depends on the lifecycle-process library for a few key features to work and the latest version of lifecycle-process depends on the androidx.startup:startup-runtime library. Hence do not remove the InitializationProvider component from the manifest. When adding other Initializers using the startup-runtime, ensure the Initializer for the lifecycle-process library is also added. Refer to the documentation to know how to add the Initializer.

Previous

Next

Was this article helpful?
1 out of 3 found this helpful

How can we improve this article?