Follow these steps to integrate MoEngage on Android:
SDK Installation
Installing using Catalog
Integration using a Version Catalog is the recommended way of integration, refer to the Configure Version Catalog document to configure a catalog if not done already. Once you have configured the catalog add the dependency in the app/build.gradle file as shown below
dependencies {
...
implementation(moengage.core)
}
Alternatively, you can add the dependency directly, as shown below.
Installing using Artifact Id
Add the following dependency in the app/build.gradle file.
dependencies {
...
implementation("com.moengage:moe-android-sdk:$sdkVersion")
}
replace $sdkVersion with the appropriate SDK version
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.
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.
implementation("androidx.core:core:1.9.0")
implementation("androidx.appcompat:appcompat:1.4.2")
implementation("androidx.lifecycle:lifecycle-process:2.5.1")
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 make sure the Initializer for lifecycle-process library is also added. Refer to the documentation to know how to add the Initializer.