Skip to content

Several packages seem to be incompatible with React Native 0.73 due to buildConfig #40559

Closed
@UNIDY2002

Description

@UNIDY2002

New Version

0.73.0-rc.1

Old Version

0.72.5

Build Target(s)

Android

Output of react-native info

System:
OS: Linux 6.1 Manjaro Linux
CPU: (16) x64 AMD Ryzen 7 5800H with Radeon Graphics
Memory: 5.39 GB / 13.51 GB
Shell:
version: 5.1.16
path: /bin/bash
Binaries:
Node:
version: 20.7.0
path: /tmp/yarn--1696745056791-0.4798124459808675/node
Yarn:
version: 1.22.19
path: /tmp/yarn--1696745056791-0.4798124459808675/yarn
npm:
version: 10.1.0
path: /usr/bin/npm
Watchman:
version: 2023.10.02.00
path: /usr/bin/watchman
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Java:
version: javac 21
path: /usr/bin/javac
Ruby: Not Found
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.73.0-rc.1
wanted: 0.73.0-rc.1
npmGlobalPackages:
"react-native": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: Not found
newArchEnabled: Not found

Issue and Reproduction Steps

Steps to reproduce:

  • Create a fresh react-native@0.73.0-rc.1 project
  • Install @react-native-async-storage/async-storage
  • Build application

Then, I can see the following error:

A problem occurred configuring project ':react-native-async-storage_async-storage'.
> 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`

I had to patch node_modules/@react-native-async-storage/async-storage/android/build.gradle and add the following code to eliminate this error:

android {
    // ...
    buildFeatures {
        buildConfig true
    }
    // ...
}

The same thing is happening to react-native-blob-util, @react-native-community/blur and some more packages.

Here are some real-world examples that showcase this error:

What is the proper way to solve this issue?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions