Configuring Build Settings
Add Androidx Libraries
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 the lifecycle-process library is also added. Refer to the documentation to know how to add the Initializer
Configure in the Package JSON file
- Setting the includeAndroidXRequiredLibraries to
trueautomatically adds the AndroidX libraries that are used by the SDK as a dependency. - Required AndroidX Libraries: The MoEngage SDK requires the following core AndroidX dependencies:
androidx.core:coreandroidx.appcompat:appcompatandroidx.lifecycle:lifecycle-process
- Before enabling this flag, validate if your application’s native Android project (
build.gradle) already has compatible versions of these libraries installed. If your app already includes them, you may not need to pull them in again, which helps prevent version conflicts or duplicate dependency errors during the build process.
Configure in the Gradle file
Skip this step if includeAndroidXRequiredLibrariesflag is enabled in previous step. Path - android/app/build.gradle(.kts)Feature Modules (optional)
To include optional modules from the MoEngage SDK based on your feature requirements, you can use the provided flags. By default, these modules are not included in your project. You can configure this by adding a new “moengage” key to the root level of your project’s package.json file. Inside this object, you can pass specific feature flags:- true: Instructs the build system to download and link the required native dependencies for that specific module.
- false (or omitting the key): Excludes the module from your project. By default, all optional modules are excluded to help keep your overall app size optimized.