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:
- Open the root
build.gradle
file of your Android project. This file is typically located in the main project directory. - 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:
Open the root
settings.gradle
file of your Android project. This file is typically located in the main project directory.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.