The Lucra Android SDK is publicly hosted on Github https://github.com/Lucra-Sports/lucra-android-sdk. Due to this, you will need a Github Personal Access Token (PAT) to pull maven artifacts via Gradle at build time.
Select "Classic" with the packages:read permissions and name it "Lucra Token". Once a token is generated, copy this and continue onto the next section, Installation
Installation
With the generated PAT, reference it it in the root level build.gradle.kts, where you'll specify the Github Maven repository to pull Lucra artifacts from. Be sure to include the other repositories as well.
Note: It is not recommended to check-in your PAT into your repository, use the gradle.properties or local.properties approach to reference your PAT at build time, for both your private build machines and any pipelines that require this dependency at build time
In your app/build.gradle.kts specify the artifacts to use in your project
Now, sync and run your project to determine if the PAT was correct and the artifacts are fetched correctly.
Build Requirements
Desurgaring
Some of the code we use requires core library desurgaring, you will need to specify this in your app/build.gradle.kts Read more about desurgaring here
Auth0 Compliance (if not already using Auth0)
We use Auth0 for auth, if your app doesn't use it already, add the following to your app's default config.
Android Manifest requirements
The following manifest permissions, features, receivers and services are required to use Lucra
Proguard Requirements
Once this is successfully completed, move onto Module Integration
repositories {
google()
mavenCentral()
// Required for Lucra SDK
maven(url = "https://zendesk.jfrog.io/zendesk/repo")
// Required for Lucra SDK
maven {
name = "LucraGithubPackages"
url = uri("https://maven.pkg.github.com/Lucra-Sports/lucra-android-sdk")
credentials {
val gprUser: String? = findProperty("GPR_USER") as String? ?: System.getenv("GPR_USER")
val gprKey: String? = findProperty("GPR_KEY") as String? ?: System.getenv("GPR_KEY")
if (gprUser.isNullOrEmpty()) {
throw GradleException("GPR_USER not set in ~ .gradle/gradle.properties, local gradle.properties or as an environment variable.")
}
if (gprKey.isNullOrEmpty()) {
throw GradleException("GPR_KEY not set in ~ .gradle/gradle.properties, local gradle.properties or as an environment variable.")
}
username = gprUser
password = gprKey // Do not check-in your PAT!
}
}
}
// All surface level APIs to interact with Lucra
implementation("com.lucrasports.sdk:sdk-core:{LATEST-VERSION}")
// Optional for UI functionality
implementation("com.lucrasports.sdk:sdk-ui:{LATEST-VERSION}")