Android build error "extra properties extension" "react-native-reanimated"

Installed the latest version and tried to build it “Android studio” following error occurred

Caused by: groovy.lang.MissingPropertyException: Cannot get property ‘react’ on extra properties extension as it does not exist

What went wrong:

A problem occurred evaluating project ‘:react-native-reanimated’. Cannot get property ‘react’ on extra properties extension as it does not exist

2.2.1 version is shown the different error FAILURE: Build completed with 2 failures.
1: Task failed with an exception.

Where:
Build file ‘/Users/apple/Desktop/meet-master/node_modules/react-native- reanimated/android/build.gradle’ line: 67

if(project.ext.react.enableHermes) {
      engine = "hermes" 
}

What went wrong:
A problem occurred evaluating project ‘:react-native-reanimated’. Cannot get property ‘react’ on extra properties extension as it does not exist

2: Task failed with an exception.

Where:
Build file ‘/Users/apple/Desktop/meet-master/android/build.gradle’ line: 117

task jitsiAndroidSourcesJar(type: Jar) {

classifier = 'sources'

from android.sourceSets.main.java.source 
}

What went wrong:
A problem occurred configuring project ‘:react-native-reanimated’. Could not get unknown property ‘android’ for task ‘:react-native- reanimated:jitsiAndroidSourcesJar’ of type org.gradle.api.tasks.bundling.Jar.

Expected behavior

Android studio build it successfully

Actual behavior & steps to reproduce

npm i react-native-reanimated@2.2.2 or ant mentioned version Manually link the library for Android or auto-link the library
Opening the project in native tool Android studio throws this build error

Facing the same errors while trying on a different version

  • 1.9.0, 2.0.0
  • 2.2.0, 2.2.1

Package versions

  • React Native: 0.63.4
  • React Native Reanimated: 2.0.0, 2.2.0, 2.2.1, 2.2.4
  • NodeJS: 14.17.6
  • Xcode: 12 iOS SDK 14.2
  • Java & Gradle: 1.8.0_271 & 6.8

Android SDK:
API Levels: 23, 28, 29, 30, 31
Build Tools: 29.0.2, 30.0.2, 30.0.3, 31.0.0

Affected platforms

  • Android - iOS

@saghul : Can you please advise on this issue

What commit are you trying to build and what changes have you made to it?

Hi @saghul , I have cloned the source from Master branch and then updated “react-native-reanimated” package to 2.2.1.

Also I’m working on integrating stream chat in JITSI UI/UX interface. So I’m facing an issue in adding the dependency libraries.

We use RN 0.61.5 for now, which is not supported b reanimated 2.