I follow your point of view (after mine) and you are right.
[versions]
agp = "9.0.1"
googleServices = "4.4.4"
crashlytics = "3.0.6"
flutter = "1.0.0"
kotlinAndroid = "1.9.24"
[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
google-services = { id = "com.google.gms.google-services", version.ref = "googleServices" }
crashlytics = { id = "com.google.firebase.crashlytics", version.ref = "crashlytics" }
kotlin = {id="org.jetbrains.kotlin.android", version.ref="kotlinAndroid"}
// Modern plugins block - replaces buildscript/classpath
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin) apply false
alias(libs.plugins.google.services) apply false
alias(libs.plugins.crashlytics) apply false
id("dev.flutter.flutter-plugin-loader") apply false
id("dev.flutter.flutter-gradle-plugin") apply false
}
// Clean task using the modern API
tasks.register<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}
/*
* Copyright 2026 Manuel Daniel Dahmen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
pluginManagement {
val flutterSdkPath = run {
val properties = java.util.Properties()
file("local.properties").inputStream().use { properties.load(it) }
val flutterSdkPath = properties.getProperty("flutter.sdk")
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
flutterSdkPath
}
includeBuild("$flutterSdkPath\\packages\\flutter_tools\\gradle")
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url = uri("https://storage.googleapis.com/download.flutter.io") }
}
}
plugins {
id("org.jetbrains.kotlin.android") version "1.9.24" apply false
// Flutter plugin Gradle: encore fragile / incompatible avec AGP 9.x -> rester sur 8.7.x
id("com.android.application") version "9.0.1" apply false
id("com.android.library") version "9.0.1" apply false
id("com.google.gms.google-services") version "4.4.4" apply false
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
id("dev.flutter.flutter-plugin-loader") version "1.0.0" apply false
}
include(":partialandroid")
include(":app")
rootProject.name = "Mesh Masks"
/*
* Copyright 2026 Manuel Daniel Dahmen
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.FileInputStream
import java.util.Properties
// At the top of your app/build.gradle file
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android") version "1.9.24" apply false
id("dev.flutter.flutter-gradle-plugin") apply false
id("com.google.gms.google-services") // Google Services plugin
id("com.google.firebase.crashlytics") // Added Firebase Crashlytics plugin
}
def keystoreProperties = new Properties()
def keystorePropertiesFile = file("C:\\Users\\manue\\AndroidStudioProjects\\empty3_mesh_masks\\android\\app\\key.properties")
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
// Define kotlinVersion as an ext property
ext.kotlinVersion = "1.9.24" // Or your desired Kotlin version
} else {
log.info("key.properties file not found")
}
android {
namespace = "one.empty3.apps.masks"
compileSdk = 36
compileOptions {
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
coreLibraryDesugaringEnabled = true
}
//kotlinOptions {
// jvmTarget = "21"
//}
packaging {
resources {
excludes.addAll(
"/META-INF/{AL2.0,LGPL2.1}",
"META-INF/DEPENDENCIES",
"META-INF/LICENSE",
"META-INF/LICENSE.txt",
"META-INF/license.txt",
"META-INF/NOTICE",
"META-INF/NOTICE.txt",
"META-INF/notice.txt",
"META-INF/ASL2.0",
//"META-INF/*.kotlin_module",
"xsd/catalog.xml",
"META-INF/LICENSE.md",
"META-INF/NOTICE.md",
"META-INF/io.netty.versions.properties",
"META-INF/INDEX.LIST",
//"META-INF/LICENSE.md", // Duplicate
"mozilla/public-suffix-list.txt",
"META-INF/LICENSE-notice.md",
//"META-INF/DEPENDENCIES", // Duplicate
//"META-INF/LICENSE", // Duplicate
//"META-INF/LICENSE.txt", // Duplicate
//"META-INF/license.txt", // Duplicate
//"META-INF/NOTICE", // Duplicate
//"META-INF/NOTICE.txt", // Duplicate
//"META-INF/notice.txt", // Duplicate
//"META-INF/ASL2.0", // Duplicate
//"META-INF/*.kotlin_module", // Duplicate
//"META-INF/INDEX.LIST", // Duplicate
"META-INF/spring.factories",
"META-INF/spring/aot.factories",
"META-INF/spring.schemas",
"META-INF/spring.tooling",
"META-INF/spring.handlers",
"META-INF/spring-configuration-metadata.json",
"META-INF/additional-spring-configuration-metadata.json",
//"/META-INF/{AL2.0,LGPL2.1}", // Duplicate
"/META-INF/native-image/*/jnijavacpp/*.json"
)
}
dex {
useLegacyPackaging = false // Recommended setting
}
}
signingConfigs {
debug {
keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["keyPassword"] as String
storeFile = file0(keystoreProperties["storeFile"])
storePassword = keystoreProperties["storePassword"] as String
}
release {
keyAlias = keystoreProperties["keyAlias"] as String
keyPassword = keystoreProperties["keyPassword"] as String
storeFile = file0(keystoreProperties["storeFile"])
storePassword = keystoreProperties["storePassword"] as String
}
}
configurations.configureEach {
//exclude(group = "org.jetbrains.kotlin', module : 'kotlin-stdlib-jdk8")
exclude group: 'org.jdom', module: 'jdom2'
exclude group: 'com.formdev', module: 'flatlaf'
exclude group: 'xpp3', module: 'xpp3'
exclude group: 'one.empty3.libs', module: 'partial-desktop'
// This is correct for Android
exclude group: 'org.jdom', module: 'jdom2'
exclude group: 'com.formdev', module: 'flatlaf'
exclude group: 'xpp3', module: 'xpp3'
exclude group: 'one.empty3.libs', module: 'partial-desktop'
// This is correct for Android
exclude group: 'xml-apis', module: 'xml-apis'
exclude group: 'net.sf.kxml', module: 'kxml2'
exclude group: 'xmlpull', module: 'xmlpull'
exclude group: 'com.sun.activation', module: 'javax.activation'
exclude group: 'org.bytedeco', module: 'javacv-platform'
exclude group: 'org.bytedeco', module: 'javacpp'
exclude group: 'org.bytedeco', module: 'leptonica'
exclude group: 'org.bytedeco', module: 'opencv'
exclude group: 'org.bytedeco', module: 'tesseract'
exclude group: 'org.bytedeco', module: 'openblas'
exclude group: 'org.bytedeco', module: 'librealsense2'
exclude group: 'org.bytedeco', module: 'ffmpeg'
exclude group: 'org.bytedeco', module: 'videoinput'
// Exclure des libs server-side à l'origine de conflits/doublons sur Android
exclude group: 'com.google.cloud.functions.invoker', module: 'java-function-invoker'
exclude group: 'com.google.api.grpc', module: 'proto-google-common-protos'
// Forcer l'usage de protobuf-javalite sur Android (évite les doublons)
exclude group: 'com.google.protobuf', module: 'protobuf-java'
// Exclure l’utilitaire full (référence Descriptors) non compatible avec javalite
exclude group: 'com.google.protobuf', module: 'protobuf-java-util'
// Exclure les modules gRPC côté serveur (référencent protobuf full et util)
exclude group: 'io.grpc', module: 'grpc-xds'
exclude group: 'io.grpc', module: 'grpc-alts'
exclude group: 'io.grpc', module: 'grpc-grpclb'
exclude group: 'io.grpc', module: 'grpc-services'
// Retirer le résolveur Google Cloud (référence xds/alts)
exclude group: 'io.grpc', module: 'grpc-googleapis'
// Eviter doublons Firestore (Firebase inclut déjà ces protos)
exclude group: 'com.google.api.grpc', module: 'proto-google-cloud-firestore-v1'
// Exclure le SDK serveur Firebase non compatible Android (cause de doublons avec firebase-common)
exclude group: 'com.google.firebase', module: 'firebase-admin'
}
defaultConfig {
applicationId = 'one.empty3.apps.masks'
minSdk = 31
targetSdk = 36
compileSdk = 36
minSdk = 31
versionCode = 3130
versionName = "1.0.0-beta4"
multiDexEnabled = true
dependenciesInfo {
// Disables dependency metadata when building APKs.
includeInApk = false
// Disables dependency metadata when building Android App Bundles.
includeInBundle = false
}
}
buildTypes {
release {
signingConfig = signingConfigs.getByName("debug")
minifyEnabled false // Mettez ceci à false temporairement
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
// Force the same JVM target for Android subprojects (Flutter plugins)
subprojects { sub ->
afterEvaluate {
if (sub.plugins.hasPlugin("com.android.application") || sub.plugins.hasPlugin("com.android.library")) {
sub.android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_21
targetCompatibility JavaVersion.VERSION_21
}
}
}
sub.tasks.withType(KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = "21"
}
}
}
}
dependencies {
//implementation(platform("io.flutter:flutter_embedding"))
// Permet d'accéder aux classes io.flutter.embedding.engine.* etc.
// Cette ligne utilise la version du moteur liée à votre SDK Flutter actuel
implementation "io.flutter:flutter_embedding_debug:1.0.0-1527ae0ec577a4ef50e65f6fefcfc1326707d9bf"
// Si vous compilez en release, le plugin flutter s'occupe normalement du reste,
// mais pour la résolution de symboles dans l'IDE et la compilation Kotlin :
implementation(platform("io.flutter:flutter_embedding_release:1.0.0-1527ae0ec577a4ef50e65f6fefcfc1326707d9bf"))
implementation "androidx.multidex:multidex:2.0.1"
implementation('com.google.android.play:age-signals:0.0.3')
implementation('com.google.gms:google-services:4.4.4')
implementation('com.google.protobuf:protobuf-java:4.33.5')
implementation("commons-codec:commons-codec:1.21.0")
// Firebase BoM
implementation(platform("com.google.firebase:firebase-bom:34.9.0"))
// Firebase Analytics (version managed by BoM)
implementation("com.google.firebase:firebase-analytics")
// Firebase Crashlytics (versions managed by BoM)
implementation("com.google.firebase:firebase-crashlytics")
implementation("com.google.firebase:firebase-crashlytics-ndk")
// Explicitly add firebase-firestore to be managed by BOM
implementation("com.google.firebase:firebase-firestore")
// You already have the Kotlin BOM specified, which is good!
implementation('one.empty3.libs:commons-mp:0.0.15')
implementation("one.empty3:empty3-library-mp:2026.2.16-21") {
exclude group: 'one.empty3.libs', module: 'partial-desktop'
}
implementation(project(":partialandroid")) {
exclude group: 'one.empty3.libs', module: 'partial-desktop'
}
implementation 'org.jetbrains:annotations:26.0.2-1'
implementation 'androidx.appcompat:appcompat:1.7.1'
implementation 'androidx.test:rules:1.7.0'
implementation 'androidx.test.ext:junit:1.3.0'
testImplementation 'junit:junit:4.13.2'
implementation 'com.google.android.material:material:1.13.0'
implementation 'com.google.mlkit:vision-common:17.3.0'
implementation 'com.google.android.gms:play-services-mlkit-face-detection:17.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
androidTestImplementation 'androidx.test:rules:1.7.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.1.5'
implementation 'com.google.android.gms:play-services-oss-licenses:17.4.0'
}
File file0(String path) {
return file(path)
}