react-native-reanimated: Build on android fails for version 2.2.1
Description
when running cd android && ./gradlew clean && cd .. && react-native run-android --variant=devDebug --appIdSuffix=dev
I get the following error:
FAILURE: Build failed with an exception.
* Where:
Build file 'my-app/node_modules/react-native-reanimated/android/build.gradle' line: 85
* What went wrong:
A problem occurred evaluating project ':react-native-reanimated'.
> Task with path ':app:mergeDebugNativeLibs' not found in project ':app'.
Expected behavior
Should not crash
Actual behavior & steps to reproduce
Update from 2.2.0 to 2.2.1
Snack or minimal code example
Package versions
- React Native:
"react-native": "0.64.2",
- React Native Reanimated:
"react-native-reanimated": "^2.2.1",
- NodeJS:
v16.8.0
- Xcode: N/A
- Java & Gradle: N/A
Affected platforms
- Android
- iOS
- Web
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 15
- Comments: 42 (2 by maintainers)
Commits related to this issue
- Fix for Android build https://github.com/software-mansion/react-native-reanimated/issues/2412#issuecomment-917958173 — committed to RocketChat/Rocket.Chat.ReactNative by diegolmello 3 years ago
- Chore: Update Reanimated to 2.2.2 (#3341) * Update reanimated to 2.2.0 * Podfile and Manifest * Update MainApplication.java * Merge develop to branch * Update yarn.lock * Run yarn *... — committed to RocketChat/Rocket.Chat.ReactNative by gerzonc 3 years ago
- fix: Android build.gradle doesn't work with flavors Fixes #2412 — committed to jtoce/react-native-reanimated by jtoce 3 years ago
- fix: Android build.gradle doesn't work with flavors (#2564) Fixes #2412 ## Description Fixed a build problem for Android users who have build flavors/variants: ``` FAILURE: Build failed with ... — committed to software-mansion/react-native-reanimated by jtoce 3 years ago
- Chore: Update Reanimated to 2.2.2 (#3341) * Update reanimated to 2.2.0 * Podfile and Manifest * Update MainApplication.java * Merge develop to branch * Update yarn.lock * Run yarn *... — committed to NextiaDev/Rocket.Chat.ReactNative by gerzonc 3 years ago
The temporary solution is to replace reanimated/build.gradle with this https://raw.githubusercontent.com/software-mansion/react-native-reanimated/2.2.0/android-npm/build.gradle
v2.2.2
fixed the issue for usNone of the above worked for me. I’m getting this error in any version > 2.1.0 😕
Thanks for all of the hints. I’ve submitted a detailed pull request with a fix for this issue: https://github.com/software-mansion/react-native-reanimated/pull/2564
I’m on 64.2 and having the same issue. I rolled back to 2.2.0, which is working fine.
still have it with 2.2.2 I’m afraid. I tried both 😞 we don’t use expo which that fix seemed to be targeted at?
@tijs I am having the same failure as the author of this issue (and also on 2.2.2).
I’m seeing this in the logs on our CI/CD:
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Does this point to an issue in react-native-reanimated or could this have to do with out own project (which does noet yet use Gradle 7)?
Edit: Reverting to 2.2.0 resolves the issue. So problem must have been introduced with 2.2.1. Which makes sense given that the mergeNativeLibs tasks were added there, see diff.
Same basic issue, none of the above suggestions resolve it except downgrading to 2.2.0
we already had the packagingOptions in our app/build.gradle. this is RN 0.63.4 manually upgraded with upgrade helper throughout the years (so if we missed some new gradle task I would love to know 😁)
I am currently using react-native version 0.64.2 and I am currently having the same problem. I downgraded to version 2.2.0 of react-native-reanimated to be able to build my app.
I can confirm that version 2.2.1 works with react-native 0.65.1
I ran into this when wanting to create a new production release.
I produce Android App Bundles for the Play Store, not APKs. The task for that
bundleProductionRelease
for me, butbundle
isn’t matched against by the newbuild.gradle
file ofreact-native-reanimated
.To fix that:
I can now produce the bundle I need, which is good.
However, every other Gradle command is broken, e.g.
gradlew clean
.Every time I need to do a
clean
I have to first deletereact-native-reanimated
from my node_modules so the above script does not run.Having the same issue with “react-native-reanimated”: “^2.3.0-beta.2” and “react-native”: “0.62.2”. Tired downgrading the version and also tried the temporary fix but none worked for me. any updates??
Downgrading to react-native-reanimated version to 2.1.0 (from 2.2.0) worked for me. I’m using react-native 0.64.2 (without expo). Some people mentioned downgrading to 2.2.0 worked for them, but it didn’t for me.
I’m getting the same error on 0.62.0 My app is hybrid and the packageOptions solution will definitely increase the apk size, so I would not like to go with that. I am getting an error on iOS as well when trying to use reanimated.
Rolling back to 2.2.0 fixes everything.
I use react-native 63.4 and react-native-reanimated 2.2.0 , but it does not build and gives such an error:
Yeah, I have barely a clue on where it comes from. Doing a quoted Google search shows this, which is not very useful. To my understanding, it’s related to Android’s NDK, but specifying it in my Gradle files yielded no results.