cannot find symbol ViewManagerResolver viewManagerResolver

Viewed 2375

Unable to build the react-native application because of library react-native-reanimated which is causing the error "cannot find symbol ViewManagerResolver viewManagerResolver"

    cannot find symbol ViewManagerResolver viewManagerResolver
/home/bhargav/projects/simplefin-mobile/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
/home/bhargav/projects/simplefin-mobile/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIImplementation.java:11: error: recursive constructor invocation
  public ReanimatedUIImplementation(
         ^
Note: /home/bhargav/projects/simplefin-mobile/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
Note: /home/bhargav/projects/simplefin-mobile/node_modules/unimodules-app-loader/android/src/main/java/org/unimodules/apploader/AppLoaderProvider.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-reanimated:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

package.json

"react": "16.11.0",
"react-native": "^0.63.4",
"react-native-reanimated": "^2.2.0",
1 Answers

Do the following:

  1. change react-native-reanimated version in your package.json to ^1.13.2

  2. then in terminal in your project root folder paste this:

    rm -rf node_modules && yarn && rm -rf ~/.gradle/caches/* && ./scripts/buildAndroidRelease.sh

  3. Then go to the your sdk location and clean the ndk folder (by default C:\Users\Your_User_name\AppData\Local\Android\Sdk\ndk)(you can also find sdk location in Android Studio -> Tools -> SDK Manager

This actions remove all previous build stuff. Now try to rebuild your app

Related