Skip to main content

2. Adding Metric's Maven Repository to Your Android Project

Note

For Older Versions of Android Studio (Before Chipmunk 2021.2.1), use the configurations below:

  1. Open the root build.gradle file of your Android project. This file is typically located in the main project directory.
  2. Inside the allprojects block, add a new repository configuration for Metric's Maven repository:
allprojects {
repositories {
maven {
url "http://android.metric.africa:8081/artifactory/metric-sdk-sdk"
allowInsecureProtocol true
credentials {
username = sdkUserName
password = sdkPassword
}
}
}
}
Info

Replace sdkUserName and sdkPassword with your actual SDK username and password.


Note

For Newer Versions of Android Studio (Chipmunk 2021.2.1 and Above), use the configuration below:

  1. Open the root settings.gradle file of your Android project. This file is typically located in the main project directory.

  2. Inside the dependencyResolutionManagement block, add a new repository configuration for Metric's Maven repository:

dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven {
url "http://android.metric.africa:8081/artifactory/metric-sdk-sdk"
allowInsecureProtocol true
credentials {
username = sdkUserName
password = sdkPassword
}
}
}
}
Info

Replace sdkUserName and sdkPassword with your actual SDK username and password.