react-native-reanimated: App does not build because of react-native-reanimated

Description

When compiling my app, React Native Reanimated gives an error in the build.gradle file:

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file '/home/mart/git/community_app_github/node_modules/react-native-reanimated/android/build.gradle' line: 21

* What went wrong:
A problem occurred evaluating project ':react-native-reanimated'.
> Plugin with id 'maven' not found.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':react-native-reanimated'.
> compileSdkVersion is not specified. Please add it to build.gradle

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 4s

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/7.0/userguide/command_line_interface.html#sec:command_line_warnings

I tried running npm update --force, but this gave an error of abs not being defined, with no js source files I can find.

Package versions

  • React Native: ^0.63.4
  • React Native Reanimated: ^1.8.0
  • NodeJS: 12.16.1
  • Xcode: N/A
  • Java & Gradle: Java 16 (java-16-jdk), Gradle 7.0

Affected platforms

  • Android

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 8
  • Comments: 30 (5 by maintainers)

Most upvoted comments

Until version 1.13.3, react-native reanimated didn’t support Gradle 7+. But since version 1.13.4 it’s possible ! yarn add react-native-reanimated@1.13.4

Should have built in Flutter

Unfortunately, we no longer support Reanimated v1 😕

Was anyone able to fix this issue?

Until version 1.13.3, react-native reanimated didn’t support Gradle 7+. But since version 1.13.4 it’s possible ! yarn add react-native-reanimated@1.13.4

working…

I am downgrading to reanimate 1 because we can’t do debugging in reanimate 2 But i am facing the same error

Unfortunately, we no longer support Reanimated v1 😕

Not every module out there supports hermes yet. You can’t just drop support for god knows how many production apps still using v1. I’ve been stuck for 2 days now and it doesn’t look like I’m making any progress what so ever.

Do I need to install yarn for that?

No, I didn’t catch that you’re using npm since most RN apps are using yarn.

I tried running npm update --force, but this gave an error of abs not being defined, with no js source files I can find.

So you managed to get past Gradle install and Metro server was using a stale cache. Try running your app with npm run start --reset-cache or manually adding --reset-cache flag in the package.json in start script section.

gradle clean failed because of the above error, I ran npm update, removed node_modules, npm install, and then tried to assembleRelease again, same error.

Did you check if Reanimated version was in fact bumped to a newer one?

Getting error

* What went wrong:
A problem occurred evaluating project ':react-native-reanimated'.
> Plugin with id 'maven' not found.

after upgrading my react native version to 0.70.6, using “react-native-reanimated”: “^1.9.0”

@hugoh59 I updated to latest version and its working

“react-native-reanimated”: “^2.13.0”,

I’m getting this error, during eas build

“expo”: “^44.0.0”, “react-native”: “0.64.3”, “react-native-reanimated”: “~2.3.1”,

/home/expo/workingdir/build/apps/mobile-app/node_modules/react-native-reanimated/android/…/…/react-native/package.json (No such file or directory)

I am getting same error during android build using eas build

Environment

"expo": "^46.0.0",
"moti": "~0.20.0",
"react-native-reanimated": "2.9.1",

Error

[RUN_GRADLEW] FAILURE: Build failed with an exception.
[RUN_GRADLEW] * Where:
[RUN_GRADLEW] Build file '/private/var/folders/r3/ynk8sm4x4znf3b_b91qj284c0000gn/T/eas-build-local-nodejs/bd4197c7-4406-4630-9e35-0530097faa37/build/apps/expo/node_modules/react-native-reanimated/android/build.gradle' line: 216
[RUN_GRADLEW] * What went wrong:
[RUN_GRADLEW] A problem occurred evaluating project ':react-native-reanimated'.
[RUN_GRADLEW] >
[RUN_GRADLEW] /private/var/folders/r3/ynk8sm4x4znf3b_b91qj284c0000gn/T/eas-build-local-nodejs/bd4197c7-4406-4630-9e35-0530097faa37/build/apps/expo/node_modules/react-native/package.json (No such file or directory)

So it seems the maven plugin is deprecated in gradle 7 (in favor of maven-publish), but gradle 6.8.3 does not seem to support java 16