Follow these steps to integrate MoEngage on Android:
SDK Installation
We have introduced integration using Version Catalog to ease out dependency and version management while integrating the various MoEngage SDKs, 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)
}
For more information about the build config and other libraries used by the MoEngage Android SDK, refer to the SDK Configuration.
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.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 make sure the Initializer for lifecycle-process library is also added. Refer to the documentation to know how to add the Initializer.