From b46ee859cc5c8470493d00612bb3cd7c76fea6a1 Mon Sep 17 00:00:00 2001 From: SuryaAbyss <168889929+SuryaAbyss@users.noreply.github.com> Date: Thu, 31 Oct 2024 20:18:51 +0530 Subject: [PATCH] Update build.gradle Reviewed Your Gradle Build Script: We looked at your original Gradle build script for the Android library related to Google ML Kit Barcode Scanning. Made Corrections and Improvements: Changed rootProject.allprojects to allprojects: Simplified the repository declaration. Added targetSdkVersion: Included this field in the defaultConfig for better practice. Simplified Namespace Check: Streamlined the conditional check for the namespace property. Provided a Revised Script: I shared the corrected version of your Gradle build script with the improvements integrated. --- .../android/build.gradle | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/google_mlkit_barcode_scanning/android/build.gradle b/packages/google_mlkit_barcode_scanning/android/build.gradle index 1300969f..fffa134a 100644 --- a/packages/google_mlkit_barcode_scanning/android/build.gradle +++ b/packages/google_mlkit_barcode_scanning/android/build.gradle @@ -12,7 +12,7 @@ buildscript { } } -rootProject.allprojects { +allprojects { repositories { google() mavenCentral() @@ -22,12 +22,12 @@ rootProject.allprojects { apply plugin: 'com.android.library' android { - // Conditional for compatibility with AGP <4.2. - if (project.android.hasProperty("namespace")) { + compileSdk 34 + + // Conditional for compatibility with AGP < 4.2. + if (project.hasProperty("namespace")) { namespace 'com.google_mlkit_barcode_scanning' } - - compileSdk 34 compileOptions { sourceCompatibility JavaVersion.VERSION_1_8 @@ -36,6 +36,7 @@ android { defaultConfig { minSdkVersion 21 + targetSdkVersion 34 // It's a good practice to specify targetSdkVersion } }