-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Closed
Labels
Description
Description
Upgrading to Android Gradle Plugin 8.1 and trying not to use the global flag
android.defaults.buildfeatures.buildconfig=true
which leads to slower builds than defining this only in needed modules
I'm getting the error:
* What went wrong:
A problem occurred configuring project ':react-native-gesture-handler'.
> defaultConfig contains custom BuildConfig fields, but the feature is disabled.
To enable the feature, add the following to your module-level build.gradle:
`android.buildFeatures.buildConfig true`
Fix: please add the flag
buildFeatures {
buildConfig = true
}
Other projects do something like this:
def agpVersion = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION
if (agpVersion.tokenize('.')[0].toInteger() >= 7) {
namespace "com.horcrux.svg"
}
to build.gradle for AGP >= 8.1
Steps to reproduce
- Upgrade to AGP 8.1
- add android.defaults.buildfeatures.buildconfig=true to gradle.properties (done by AGP upgrade wizard in AS)
- ./gradlew assDebug
Snack or a link to a repository
none
Gesture Handler version
2.12.1
React Native version
0.72.2
Platforms
Android
JavaScript runtime
None
Workflow
None
Architecture
None
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes
Reactions are currently unavailable