Android SDK Installation
Follow

Set up repositories

Add the mavenCentral() repository in the project-level build.gradle file, ignore if it's already added.

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.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, ensure the Initializer for the 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