buildscript { ext.MyidSdk = [ kotlinVersion: "2.0.21", minSdkVersion: 24, compileSdkVersion: 36, // Override from the app's root build.gradle: // ext { myIdCaptureSdkVersion = "3.1.9" } myIdCaptureSdkVersion: "3.1.9" ] ext.getExtOrDefault = { prop -> if (rootProject.ext.has(prop)) { return rootProject.ext.get(prop) } return MyidSdk[prop] } repositories { google() mavenCentral() } dependencies { classpath "com.android.tools.build:gradle:8.7.2" // noinspection DifferentKotlinGradleVersion classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${getExtOrDefault('kotlinVersion')}" } } apply plugin: "com.android.library" if (project.extensions.findByName("kotlin") == null) { apply plugin: "kotlin-android" } apply plugin: "com.facebook.react" android { namespace "com.myidsdk" compileSdkVersion getExtOrDefault("compileSdkVersion") defaultConfig { minSdkVersion getExtOrDefault("minSdkVersion") } compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } } // MyID artifacts live outside Maven Central: // artifactory.aigroup.uz - the SDK itself, public read access, no credentials // developer.huawei.com - com.huawei.hms:safetydetect, pulled in by // myid-integrity-sdk, which the capture SDK depends on // // These are registered on every project, not just this one, because a consuming // app resolves our transitive dependencies against ITS OWN repository set when // building its runtime classpath. A module-level repositories block here is // enough to compile this library in isolation but still fails the app build // with "Could not find uz.myid.sdk.capture:myid-capture-sdk". // // Apps that manage repositories centrally (dependencyResolutionManagement with // FAIL_ON_PROJECT_REPOS) must set myIdSkipRepositoryInjection=true in // gradle.properties and declare the two URLs themselves — see the README. if (!rootProject.hasProperty("myIdSkipRepositoryInjection")) { rootProject.allprojects { repositories { maven { url "https://artifactory.aigroup.uz/artifactory/myid/" } maven { url "https://developer.huawei.com/repo/" } } } } repositories { google() mavenCentral() maven { url "https://artifactory.aigroup.uz/artifactory/myid/" } maven { url "https://developer.huawei.com/repo/" } } dependencies { implementation "com.facebook.react:react-android" // The debug artifact is a separate, non-obfuscated build of the same SDK. // Apps that define build types other than debug/release must declare // matchingFallbacks for them, otherwise resolution fails — see the README. debugImplementation "uz.myid.sdk.capture:myid-capture-sdk-debug:${getExtOrDefault('myIdCaptureSdkVersion')}" releaseImplementation "uz.myid.sdk.capture:myid-capture-sdk:${getExtOrDefault('myIdCaptureSdkVersion')}" }