Installing Core SDK

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 the catalog is configures, add the dependency in the app/build.gradle file as shown below

build.gradle
dependencies {
    ...
    implementation(moengage.core)
}

Alternatively, you can add the dependency using Artifact ID as described in Installation using Artifact ID. However, installation using Catalog ID is the recommended approach as installing using Artifact ID may lead to version mismatch if mapped incorrectly. 

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.

Groovy
implementation("androidx.core:core:1.9.0")
implementation("androidx.appcompat:appcompat:1.6.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 lifecycle-process library is also added. Refer to the documentation to know how to add the Initializer.

Previous

Next

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

How can we improve this article?