[Android] Java patch doesn't seem to be applied when building from cache
See original GitHub issueDescription
Since I upgraded to version 2.5.0, whenever I change a dependency not related to react-native-reanimated and start an Android build from existing cache, the ReanimatedUIImplementation.java doesn’t seem to be patched and will result in the following error:
...\node_modules\react-native-reanimated\android\src\main\java\com\swmansion\reanimated\layoutReanimation\ReanimatedUIImplementation.java:13: error: cannot find symbol
ViewManagerResolver viewManagerResolver,
^
symbol: class ViewManagerResolver
location: class ReanimatedUIImplementation
Cleaning Android build and re-building from scratch does work. However, this means that our CI cannot rely on Android build cache anymore.
Expected behavior
I should be able to re-build sucessfully from cache whenever Android project or dependency changes.
Actual behavior & steps to reproduce
Snack or minimal code example
Package versions
| name | version |
|---|---|
| react-native | 0.63.4 |
| react-native-reanimated | 2.5.0 |
| NodeJS | 14.17.0 |
| Xcode | |
| Java | 1.8 |
| Gradle | 4.1.2 |
| expo |
Affected platforms
- Android
- iOS
- Web
Issue Analytics
- State:
- Created a year ago
- Comments:16
Top Results From Across the Web
Android Studio not deploying changes to app - Stack Overflow
By going to device settings >> Apps >> myApp >> Clear caches & clear data , the new changes deployed to the app....
Read more >Caching in the Android Build Process | by Sherry Yuan
To bypass the build cache, you can use the --no-build-cache flag. If a clean wasn't enough to fix your build errors, try running...
Read more >Troubleshooting tips for running Java
Clear the Java cache (temporary) files Sometimes a corrupted file in the Java cache can prevent an application from running. You can safely...
Read more >Slow rendering - Android Developers
ListView and especially RecyclerView are commonly used for complex scrolling lists that are most susceptible to jank. They both contain Systrace ...
Read more >Upgrading your build from Gradle 4.x to 5.0
If you are using Gradle for Android, you need to move to version 3.3 or higher of both the Android Gradle Plugin and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I fixed this way.
yarn remove react-native-reanimatedyarn add react-native-reanimated@^2.4.1yarn run androidIt worked like a charm!
I manage to fix this by updating the React, react-native and babel/core versions
react: 16.13.1 -> 17.0.2 react-native: 0.63.4 -> 0.66.1 @babel/core: ^7.8.4 -> ^7.12.9
I think that only updating react might solve it but I updated the 3