From aa5c9f835d93ea7c5eac60835e63a16a122661f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacy=20=C5=81=C4=85tka?= Date: Mon, 2 Sep 2024 09:43:33 +0200 Subject: [PATCH] [Android] Drop support for `AGP version <= 7` (#3077) ## Description This PR removes support for Android Gradle Plugin `version <= 7` `AGP version 7` is unsupported by React Native since `0.73` Closes: #2725 ## Test plan - build example `Android` app while using `AGP 8.0` - build example `Android` app while using `AGP 9.0` - both should run successfully --------- Co-authored-by: Jakub Piasecki --- README.md | 1 + android/build.gradle | 21 ++++----------------- android/src/main/AndroidManifest.xml | 4 +--- 3 files changed, 6 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 0b405b76b3..310f0e515b 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ You will need to have an Android or iOS device or emulator connected. | version | react-native version | | ------- | -------------------- | +| 2.18.0+ | 0.73.0+ | | 2.16.0+ | 0.68.0+ | | 2.14.0+ | 0.67.0+ | | 2.10.0+ | 0.64.0+ | diff --git a/android/build.gradle b/android/build.gradle index 79aaec30a2..16d48d2353 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,8 +1,5 @@ import groovy.json.JsonSlurper -import javax.inject.Inject -import java.nio.file.Files - buildscript { def kotlin_version = rootProject.ext.has('kotlinVersion') ? rootProject.ext.get('kotlinVersion') : project.properties['RNGH_kotlinVersion'] @@ -98,15 +95,11 @@ repositories { android { compileSdkVersion safeExtGet("compileSdkVersion", 33) - def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION - if (agpVersion.tokenize('.')[0].toInteger() >= 7) { - namespace "com.swmansion.gesturehandler" - } - if (agpVersion.tokenize('.')[0].toInteger() >= 8) { - buildFeatures { - buildConfig = true - } + namespace "com.swmansion.gesturehandler" + buildFeatures { + buildConfig = true + prefab = true } // Used to override the NDK path/version on internal CI or by allowing @@ -118,12 +111,6 @@ android { ndkVersion rootProject.ext.ndkVersion } - if (REACT_NATIVE_MINOR_VERSION >= 71) { - buildFeatures { - prefab true - } - } - defaultConfig { minSdkVersion safeExtGet('minSdkVersion', 21) targetSdkVersion safeExtGet('targetSdkVersion', 33) diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml index 5fa4c9c519..94cbbcfc39 100644 --- a/android/src/main/AndroidManifest.xml +++ b/android/src/main/AndroidManifest.xml @@ -1,3 +1 @@ - - +