Files
self/app/android/build.gradle
2026-04-25 14:27:37 -07:00

100 lines
3.7 KiB
Groovy

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 36
targetSdkVersion = 36
// Updated NDK to support 16k page size devices (RN 0.77)
ndkVersion = "28.0.13004108"
// ndkVersion = "27.1.12297006"
kotlinVersion = "2.0.21"
firebaseMessagingVersion = "23.4.0"
firebaseBomVersion = "32.7.3"
}
repositories {
google()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath('com.android.tools.build:gradle:8.11.2')
classpath("com.facebook.react:react-native-gradle-plugin")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath 'com.google.gms:google-services:4.4.0'
// Removed firebase-crashlytics (no usages)—add back 3.x if still applied in modules.
// Removed rust-android-gradle plugin; keep only if you re-enable Rust integration.
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter()
maven {
url("$rootDir/../../node_modules/react-native/android")
}
maven {
url("$rootDir/../../node_modules/jsc-android/dist")
}
maven { url 'https://jitpack.io' }
maven { url "https://raw.githubusercontent.com/didit-protocol/sdk-android/main/repository" }
}
configurations.configureEach {
resolutionStrategy.dependencySubstitution {
substitute module('io.fotoapparat:fotoapparat') using module('com.github.fotoapparat:fotoapparat:2.7.0')
}
// Exclude com.gemalto.jp2:jp2-android (ships non-16KB-aligned libopenjpeg.so).
// JMRTD's pure-Java JJ2000Decoder handles JP2 decoding without it.
exclude group: 'com.gemalto.jp2', module: 'jp2-android'
}
configurations.all {
resolutionStrategy {
force 'com.google.firebase:firebase-iid:21.1.0'
}
}
}
subprojects {
afterEvaluate { project ->
if (project.hasProperty('android')) {
android {
def manifestFile = project.file('src/main/AndroidManifest.xml')
def buildGradleFile = project.file('build.gradle')
if (buildGradleFile.exists()) {
def buildGradleText = buildGradleFile.text
def namespaceMatcher = buildGradleText =~ /namespace\s*['"](.+?)['"]/
if (namespaceMatcher.find()) {
namespace = namespaceMatcher[0][1]
println "Set namespace for ${project.name} to ${namespace} from build.gradle"
return
}
}
if (manifestFile.exists()) {
def manifestText = manifestFile.text
def packageMatcher = manifestText =~ /package="([\w\.]+)"/
if (packageMatcher.find()) {
def packageName = packageMatcher[0][1]
namespace = packageName
println "Set namespace for ${project.name} to ${namespace} from AndroidManifest.xml"
} else {
namespace = project.group
println "No 'package' attribute found. Set namespace for ${project.name} to ${namespace}"
}
} else {
namespace = project.group
println "AndroidManifest.xml not found. Set namespace for ${project.name} to ${namespace}"
}
}
}
}
}
apply plugin: "com.facebook.react.rootproject"