question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android] Java patch doesn't seem to be applied when building from cache

See original GitHub issue

Description

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:open
  • Created a year ago
  • Comments:16

github_iconTop GitHub Comments

10reactions
cleandevcodecommented, Apr 15, 2022

I fixed this way.

yarn remove react-native-reanimated yarn add react-native-reanimated@^2.4.1 yarn run android

It worked like a charm!

2reactions
FabioMFGasparcommented, Apr 28, 2022

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found