react-native-reanimated: RN 0.61 Android build fails
This likely has to do with AndroidX or other things of which I am somewhat ignorant, but here’s what I can share:
I had react-native-reanimated working fine in my RN 0.60.5 app. Today I tried to upgrade to RN 0.61, and the Android build (via react-native run-android
) stopped working. It gave an error message like this:
/.../android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:37: error: package com.swmansion.reanimated does not exist
import com.swmansion.reanimated.ReanimatedPackage;
^
/.../android/app/build/generated/rncli/src/main/java/com/facebook/react/PackageList.java:89: error: cannot find symbol
new ReanimatedPackage(),
^
symbol: class ReanimatedPackage
location: class PackageList
2 errors
FAILURE: Build failed with an exception.
I examined the changes to the android directory of the RN template that occurred between 0.60.5 and 0.61, and this one looks relevant: https://github.com/facebook/react-native/pull/25810
When I re-add the supportLibVersion
line to my android/build.gradle, the build seems to work again. I’m not sure if this is proper or if it implies something is going wrong with the jetify process for this library.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 12
- Comments: 21 (2 by maintainers)
I am still facing this.
My package.json:
Command used to run:
I also get the same issue when updating
react-native-reanimated
to1.4.0
I managed to fix this by adding this into my
build.gradle
I removed the following lines from
MainApplication.java
and it worked for me!For me, the build failed because I still had the code suggested in this comment in my
build.gradle
. Removing that code, together with thesupportLibVersion
line and upgrading to1.4.0
did it for me.RN 0.62.2 and reanimated 1.9.0 This worked for me: At root project.
npm install -g jetifier
npx jetify
None of the fix above fixed it for me, I’m using expo navigation and it recommends and installed ~1.1.0. IF I install 1.4.0 it will show error or warning that doesn’t look good, but the bug is still there.
I already have the supportLibVersion in my build.gradle but i am still getting these build errors on RN 0.61.2
Logs
Closing as of #395