Knomi S Face Integration

Estimated reading: 2 minutes 10 views

Step 1: Configure Your settings.gradle File

This file tells Gradle where to look for your private package. Open the settings.gradle file in the root of your project and ensure it looks like this:

// settings.gradle

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        
        // Add the private GitHub repository for Knomi S Face
        maven {
            url = uri("https://maven.pkg.github.com/Aware-Distribution/Android-Knomi-S-Face")
            credentials {
                if (settings.hasProperty('gpr.user')) {
                    username = settings['gpr.user']
                }
                if (settings.hasProperty('gpr.key')) {
                    password = settings['gpr.key']
                }
            }
        }
    }
}

rootProject.name = "My Application"
include ':app'

Step 2: Configure Your gradle.properties File

gpr.user=Aware-Distribution
gpr.key={{KEY-HERE}}

Step 3: Add the Dependency to app/build.gradle

Now, open the build.gradle file located inside your app module. Add the implementation line for the face-capturelibrary inside the dependencies block.

// app/build.gradle

// ... (plugins and android blocks) ...

dependencies {
    // Other dependencies like core-ktx, appcompat, etc.
    // ...
    // Add these lines for the face-capture and face-capture-device-control libraries
    implementation 'com.aware-distribution:knomi-s-face:3.7.0'
}

Step 3: Sync Your Project

In Android Studio, a bar will appear at the top of the editor prompting you to sync. Click "Sync Now". Gradle will now use your credentials to find and download the library from your private repository.


CONTENTS