// based on: // * https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle // * https://github.com/facebook/react-native/blob/0.60-stable/template/android/app/build.gradle def DEFAULT_COMPILE_SDK_VERSION = 34 def DEFAULT_BUILD_TOOLS_VERSION = '34.0.0' def DEFAULT_MIN_SDK_VERSION = 24 def DEFAULT_TARGET_SDK_VERSION = 34 def safeExtGet(prop, fallback) { rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback } buildscript { ext { buildToolsVersion = "34.0.0" minSdkVersion = 24 compileSdkVersion = 34 targetSdkVersion = 34 kotlinVersion = "1.9.10" // Stable version compatible with most RN apps } // The Android Gradle plugin is only required when opening the android folder stand-alone. // This avoids unnecessary downloads and potential conflicts when the library is included as a // module dependency in an application project. if (project == rootProject) { repositories { google() mavenCentral() } dependencies { classpath 'com.android.tools.build:gradle:8.3.2' // Stable LTS AGP version classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" } } } apply plugin: 'com.android.library' apply plugin: 'kotlin-android' def getExtOrDefault(name) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : project.properties['ReactNative_' + name] } def getExtOrIntegerDefault(name) { return rootProject.ext.has(name) ? rootProject.ext.get(name) : (project.properties['ReactNative_' + name]).toInteger() } def supportsNamespace() { def parsed = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.') def major = parsed[0].toInteger() def minor = parsed[1].toInteger() // Namespace support was added in 7.3.0 return (major == 7 && minor >= 3) || major >= 8 } android { if (supportsNamespace()) { namespace "io.linkrunner" sourceSets { main { manifest.srcFile "src/main/AndroidManifestNew.xml" } } } compileSdkVersion getExtOrIntegerDefault('compileSdkVersion') defaultConfig { minSdkVersion getExtOrIntegerDefault('minSdkVersion') targetSdkVersion getExtOrIntegerDefault('targetSdkVersion') versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false } } lintOptions { disable 'GradleCompatible' } compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { jvmTarget = '17' // Match Java version } } repositories { mavenLocal() maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } maven { // Android JSC is installed from npm url "$rootDir/../node_modules/jsc-android/dist" } google() mavenCentral() maven { url 'https://www.jitpack.io' } } dependencies { // React Native - use compileOnly to avoid version conflicts implementation 'com.facebook.react:react-android:0.80.0' // Linkrunner SDK implementation "io.linkrunner:android-sdk:4.4.0" // Kotlin standard libraries - use stable versions implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion" // AndroidX dependencies - matching Android SDK exactly implementation 'androidx.core:core-ktx:1.12.0' implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.7.0' implementation 'androidx.lifecycle:lifecycle-process:2.7.0' // Network dependencies - matching Android SDK versions implementation 'com.squareup.retrofit2:retrofit:2.11.0' implementation 'com.squareup.retrofit2:converter-gson:2.11.0' implementation 'com.squareup.okhttp3:logging-interceptor:4.12.0' // Coroutines - matching Android SDK implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.0' implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.8.0' // Google Play Services - matching Android SDK exactly implementation 'com.google.android.gms:play-services-ads-identifier:18.0.1' implementation 'com.google.android.gms:play-services-appset:16.0.2' implementation 'com.android.installreferrer:installreferrer:2.2' }