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 you have configured the catalog add the dependency in the app/build.gradle file as shown below

build.gradle

    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.

build.gradle

    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.

Groovy

    implementation("androidx.core:core:1.6.0")
    implementation("androidx.appcompat:appcompat:1.3.1")
    implementation("androidx.lifecycle:lifecycle-process:2.4.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.

Was this article helpful?
0 out of 0 found this helpful