Skip to content

Commit

Permalink
[Android] Drop support for AGP version <= 7 (#3077)
Browse files Browse the repository at this point in the history
## 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 <[email protected]>
  • Loading branch information
latekvo and j-piasecki authored Sep 2, 2024
1 parent cdc2e60 commit aa5c9f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 20 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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+ |
Expand Down
21 changes: 4 additions & 17 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -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']

Expand Down Expand Up @@ -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
Expand All @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions android/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.swmansion.gesturehandler">
</manifest>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />

0 comments on commit aa5c9f8

Please sign in to comment.