Skip to content

Commit

Permalink
fix: enable buildFeatures.buildConfig for AGP 8+ (#285)
Browse files Browse the repository at this point in the history
## 馃摐 Description

Enabled `buildFeatures.buildConfig` for Android Gradle Plugin 8+.

## 馃挕 Motivation and Context

In new react-native version 0.73 FB team switched to AGP 8. For AGP 8+
it's crucial to add `buildConfig true` under `buildFeatures` if you are
using `BuildConfig` with custom configuration (this package is using it
for distinguishing 2 different architectures - paper and fabric).

I decided to add it under `AGP >= 7` condition because it will not break
anything and such condition will be evaluated as `true` for AGP 8.

## 馃摙 Changelog

### Android
- added  `buildFeature { buildConfig true }` if AGP is 7+;

## 馃 How Has This Been Tested?

Tested manually and via CI builds.

## 馃摑 Checklist

- [x] CI successfully passed
  • Loading branch information
kirillzyusko committed Dec 1, 2023
1 parent 35d0ada commit 9cff79c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ android {
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
namespace "com.reactnativekeyboardcontroller"
buildFeatures {
buildConfig true
}
}

compileSdkVersion getExtOrIntegerDefault('compileSdkVersion')
Expand Down

0 comments on commit 9cff79c

Please sign in to comment.