2

I am new to react-native I am trying to generate an apk for testing using the command ./gradlew assembleDebug but I get an error knowing ./gradlew clean executes successfully!

./gradlew assembleDebug

Configure project :expo

Using expo modules

  • expo-asset (11.0.1)
  • expo-constants (17.0.3)
  • expo-file-system (18.0.6)
  • expo-font (13.0.2)
  • expo-keep-awake (14.0.1)
  • expo-modules-core (2.1.2)

Configure project :react-native-reanimated Android gradle plugin: 8.6.0 Gradle: 8.10.2

Task :react-native-reanimated:generateCodegenArtifactsFromSchema C:\Users\user\Desktop\project\project\node_modules\react-native\node_modules@react-native\codegen\lib\generators\modules\GenerateModuleJniCpp.js:439 .map(property => ^

TypeError: Cannot read properties of undefined (reading 'map') at C:\Users\user\Desktop\project\project\node_modules\react-native\node_modules@react-

Node.js v22.11.0

Task :react-native-reanimated:generateCodegenArtifactsFromSchema FAILED

FAILURE: Build failed with an exception.

1 Answer 1

0

Try clearing the build cache and node modules:

cd android
./gradlew clean
cd ..
rm -rf node_modules
npm install

Downgrade to react-native-reanimated to version2.17.0:

npm install [email protected]

If the above suggestions don’t work, then you’ll have to include the versions of react-native and react-native-reanimated you’re using in your question. The error suggests a potential version mismatch between both packages. Hope this helps!

EDIT I:

Alternatively, try installing react-native-reanimated 3.6.1 instead:

npm uninstall react-native-reanimated
npm install [email protected]

Then clean and rebuild:

cd android
./gradlew clean
./gradlew assembleDebug

EDIT II:

Check if your babel.config.js includes the following:

module.exports = {
  presets: ['module:@react-native/babel-preset']
}

Fix node version - downgrade to Node 18:

nvm install 18
nvm use 18

Clean and rebuild:

rm -rf node_modules
npm install
cd android
./gradlew clean
./gradlew assembleDebug

If the error persists, let me know.

7
  • I have already tried to clear the build cache and node modules, but the problem is still present. here are the versions I use "react": 18.2.0", "react-native": "0.74.3","react-native-reanimated": "3.15.3"
    – dev
    Commented Dec 31, 2024 at 15:18
  • [email protected] is not compatible with react nation version i use
    – dev
    Commented Dec 31, 2024 at 16:23
  • I edited my answer to include another suggestion Commented Jan 2 at 2:56
  • I did that but same error
    – dev
    Commented Jan 3 at 16:00
  • even if I uninstall react-native-reanimated , i have also this error ==> Task :react-native-safe-area-context:generateCodegenArtifactsFromSchema FAILED C:\Users\user\Desktop\project\project\node_modules\react-native\node_modules\@react-native\codegen\lib\generators\modules\GenerateModuleJniCpp.js:439 .map(property =>
    – dev
    Commented Jan 3 at 17:08

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.