react-native-reanimated: Execution failed for task ':react-native-reanimated:compileDebugJavaWithJavac'.

Description

> Task :react-native-reanimated:compileDebugJavaWithJavac FAILED
aapt2 W 11-04 14:19:29 66234 2702028 LoadedArsc.cpp:682] Unknown chunk type '200'.


Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.2/userguide/command_line_interface.html#sec:command_line_warnings
203 actionable tasks: 203 executed
Warning: Mapping new ns http://schemas.android.com/repository/android/common/02 to old ns http://schemas.android.com/repository/android/common/01
Warning: Mapping new ns http://schemas.android.com/repository/android/generic/02 to old ns http://schemas.android.com/repository/android/generic/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/02 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/addon2/03 to old ns http://schemas.android.com/sdk/android/repo/addon2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/02 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/repository2/03 to old ns http://schemas.android.com/sdk/android/repo/repository2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/03 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Warning: Mapping new ns http://schemas.android.com/sdk/android/repo/sys-img2/02 to old ns http://schemas.android.com/sdk/android/repo/sys-img2/01
Note: **********/node_modules/@bugsnag/react-native/android/src/main/java/com/bugsnag/android/ReactNativeCompat.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: *********/node_modules/@react-native-community/slider/android/src/oldarch/java/com/reactnativecommunity/slider/ReactSliderManager.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.




node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java:15: error: cannot find symbol
class ReaUiImplementationProvider extends UIImplementationProvider {
                                          ^
  symbol: class UIImplementationProvider
********/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java:17: error: method does not override or implement a method from a supertype
  @Override
  ^
********/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java:38: error: no suitable constructor found for UIManagerModule(ReactApplicationContext,List<ViewManager>,ReaUiImplementationProvider,int)
    super(
    ^
    constructor UIManagerModule.UIManagerModule(ReactApplicationContext,ViewManagerResolver,int) is not applicable
      (actual and formal argument lists differ in length)
    constructor UIManagerModule.UIManagerModule(ReactApplicationContext,List<ViewManager>,int) is not applicable
      (actual and formal argument lists differ in length)
Note: Some input files use or override 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.
3 errors

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.

Steps to reproduce

I’ve been uninstalling, re-installing, clearing caches and resetting everything I can at every stage. Can’t seem to resolve this issue

Mac M1, Android Studio

Snack or a link to a repository

Reanimated version

2.12.0 (but also occurred in ^2.11.0)

React Native version

0.65.0

Platforms

Android

JavaScript runtime

No response

Workflow

React Native (without Expo)

Architecture

Paper (Old Architecture)

Build type

Debug mode

Device

Android emulator

Device model

No response

Acknowledgements

Yes

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 26
  • Comments: 65 (1 by maintainers)

Most upvoted comments

Here is the way how i fixed this issue :-

1st go to android/build.gradle

//2nd find allprojects ,then add below def line exact above of the allprojects { ... } section staring

def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

allprojects {

//3rd go inside allprojects { ... } ,then add below configurations.all { ... } , at this top section inside  allprojects { ... }
	
	//this section only start
    configurations.all {
        resolutionStrategy {
            force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
        }
    }
	//this section only end


    // keep all below default codes as it is
    repositories {
       ....
    }

}

Can confirm that this works: https://github.com/facebook/react-native/issues/35204#issuecomment-1304099109

android/build.gradle

allprojects {

    repositories { /* ... */ }

    configurations.all {
        resolutionStrategy {
            force 'com.facebook.react:react-native:0.63.4'
        }
    }
}

I’m also seeing something similar. I’m on RN v0.63.3, react-native-reanimated v2.6.0. It seems to have appeared out of nowhere. My app was compiling correctly literally 2 days ago. Now, with absolutely no change on my end, it seems to be failing here:

/Users/sameermadan/gezunt/gezuntpatient/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java:15: error: cannot find symbol
class ReaUiImplementationProvider extends UIImplementationProvider {
                                          ^
  symbol: class UIImplementationProvider
/Users/sameermadan/gezunt/gezuntpatient/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIImplementation.java:13: error: cannot find symbol
      UIManagerModule.ViewManagerResolver viewManagerResolver,
                     ^
  symbol:   class ViewManagerResolver
  location: class UIManagerModule
/Users/sameermadan/gezunt/gezuntpatient/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java:17: error: method does not override or implement a method from a supertype
  @Override
  ^
/Users/sameermadan/gezunt/gezuntpatient/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java:38: error: no suitable constructor found for UIManagerModule(ReactApplicationContext,List<ViewManager>,ReaUiImplementationProvider,int)
    super(
    ^
    constructor UIManagerModule.UIManagerModule(ReactApplicationContext,ViewManagerResolver,int) is not applicable
      (actual and formal argument lists differ in length)
    constructor UIManagerModule.UIManagerModule(ReactApplicationContext,List<ViewManager>,int) is not applicable
      (actual and formal argument lists differ in length)
/Users/sameermadan/gezunt/gezuntpatient/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIImplementation.java:11: error: recursive constructor invocation
  public ReanimatedUIImplementation(
         ^
Note: Some input files use or override 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.
5 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-reanimated:compileDebugJavaWithJavac'.

I’m glad I’m not alone lol

Here this same problem begin happen today without i changed my code, yesterday it was all working, whats happening?

SOLVED IT…!!!

followed solution suggested by @mishkeTz

Also updated react-native-reanimated from “2.10.0” to “2.12.0”

Can confirm that this works: facebook/react-native#35204 (comment)

android/build.gradle

allprojects {

    repositories { /* ... */ }

    configurations.all {
        resolutionStrategy {
            force 'com.facebook.react:react-native:0.63.4'
        }
    }
}

Seeing this as well on 2.10.0

> Task :react-native-reanimated:compileReleaseJavaWithJavac FAILED
/Users/vagrant/git/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIManager.java:15: [REDACTED]: cannot find symbol
class ReaUiImplementationProvider extends UIImplementationProvider {
                                          ^

The issue started happening today without any modifications to our application

I have solved this by writing following code in android/build.gradle

def REACT_NATIVE_VERSION = new File(['node', '--print', "JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

 
allprojects {
    configurations.all {
        resolutionStrategy {
            force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
        }
    }


     repositories {
         mavenLocal()
         maven {

SOLVED IT!!!

By using proposed solution in this link, i solved this issue

Change build.gradle file as follows:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    // ...
}


allprojects {
    repositories {
+       exclusiveContent {
+           // We get React Native's Android binaries exclusively through npm,
+           // from a local Maven repo inside node_modules/react-native/.
+           // (The use of exclusiveContent prevents looking elsewhere like Maven Central
+           // and potentially getting a wrong version.)
+           filter {
+               includeGroup "com.facebook.react"
+           }
+           forRepository {
+               maven {
+                   url "$rootDir/../node_modules/react-native/android"
+               }
+           }
+       }
        // ...
    }
}

I am also facing the same issue. Started happening from today only… react-native: 0.69.6 react-native-reanimated: 2.10

error: cannot find symbol class ReaUiImplementationProvider extends UIImplementationProvider { ^ symbol: class UIImplementationProvider

error: no suitable constructor found for UIManagerModule(ReactApplicationContext,List<ViewManager>,ReaUiImplementationProvider,int) super( ^ constructor UIManagerModule.UIManagerModule(ReactApplicationContext,ViewManagerResolver,int) is not applicable (actual and formal argument lists differ in length) constructor UIManagerModule.UIManagerModule(ReactApplicationContext,List<ViewManager>,int) is not applicable (actual and formal argument lists differ in length)

Bug solution with problem explication here : https://github.com/facebook/react-native/issues/35204

Here is the way how i fixed this issue :-

1st go to android/build.gradle

//2nd find allprojects ,then add below def line exact above of the allprojects { ... } section staring

def REACT_NATIVE_VERSION = new File(['node', '--print',"JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())

allprojects {

//3rd go inside allprojects { ... } ,then add below configurations.all { ... } , at this top section inside  allprojects { ... }
	
	//this section only start
    configurations.all {
        resolutionStrategy {
            force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
        }
    }
	//this section only end


    // keep all below default codes as it is
    repositories {
       ....
    }

}

working fine

upgrading react-native-reanimated to v2.12.0 worked for me.

react-native:0.69.4 previous react-native-reanimated version: 2.10.0 current react-native-reanimated version: 2.12.0

Installing Facebook’s hot-fix solved the issue for me. They released an update to all affected versions. Facebook’s Update

SOLVED IT…!!!

followed solution suggested by @mishkeTz

Also updated react-native-reanimated from “2.10.0” to “2.12.0”

Can confirm that this works: facebook/react-native#35204 (comment) android/build.gradle

allprojects {

    repositories { /* ... */ }

    configurations.all {
        resolutionStrategy {
            force 'com.facebook.react:react-native:0.63.4'
        }
    }
}

It worked for me but instead of 0.63.4 I used the 0.70.1 which is the one I have on my project

Update react-native-reanimated to 2.12.0 helped.

facebook/react-native#35204 (comment)

Upgrading react-native-reanimated from “2.9.1” to “2.12.0” Worked for me!

npm i react-native-reanimated@2.12.0

Guys, prefer using that method in that PR to avoid using specific versions in your build.gradle

SOLVED IT…!!!

followed solution suggested by @mishkeTz Also updated react-native-reanimated from “2.10.0” to “2.12.0”

Can confirm that this works: facebook/react-native#35204 (comment) android/build.gradle

allprojects {

    repositories { /* ... */ }

    configurations.all {
        resolutionStrategy {
            force 'com.facebook.react:react-native:0.63.4'
        }
    }
}

It worked for me but instead of 0.63.4 I used the 0.70.1 which is the one I have on my project

It worked for me, using 0.70.0 my project’s version

There react-native hotfix versions now which doesn’t require to modify android/build.gradle: https://github.com/facebook/react-native/issues/35210