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.

App does not compile on Android "compileReleaseJavaWithJavac"

See original GitHub issue

Description

I’m trying to build the app by doing ./gradlew assemblerelease. I now get an error message.

Expected behavior

App builds successfully

Actual behavior & steps to reproduce

App fails to build.

Here is the log:

> Task :react-native-reanimated:compileReleaseJavaWithJavac
/Users/humad/Desktop/tvproject-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

> Task :react-native-community_datetimepicker:compileReleaseJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :react-native-haptic-feedback:compileReleaseJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :react-native-fast-image:compileReleaseJavaWithJavac
Note: [2] Wrote GeneratedAppGlideModule with: [com.bumptech.glide.integration.okhttp3.OkHttpLibraryGlideModule, com.dylanvann.fastimage.FastImageOkHttpProgressGlideModule]

> Task :unimodules-core:compileReleaseJavaWithJavac
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :react-native-reanimated:compileReleaseJavaWithJavac
/Users/humad/Desktop/tvproject-mobile/node_modules/react-native-reanimated/android/src/main/java/com/swmansion/reanimated/layoutReanimation/ReanimatedUIImplementation.java:11: error: recursive constructor invocation
  public ReanimatedUIImplementation(
         ^

> Task :react-native-firebase_app:compileReleaseJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :react-native-reanimated:compileReleaseJavaWithJavac FAILED
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.
2 errors

> Task :expo-application:compileReleaseJavaWithJavac
Note: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-application/android/src/main/java/expo/modules/application/ApplicationModule.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

> Task :expo-dev-menu:compileReleaseKotlin
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-menu/android/src/release/java/expo/modules/devmenu/DevMenuManager.kt: (22, 42): Returning type parameter has been inferred to Nothing implicitly. Please, specify type arguments explicitly to hide this warning. Nothing can produce an exception at runtime.
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-menu/android/src/release/java/expo/modules/devmenu/DevMenuManager.kt: (84, 43): The corresponding parameter in the supertype 'DevMenuManagerInterface' is named 'shouldAutoLaunch'. This may cause problems when calling this function with named arguments.

> Task :expo-dev-launcher:compileReleaseKotlin
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/DevLauncherActivity.kt: (31, 25): 'constructor Handler()' is deprecated. Deprecated in Java
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/configurators/DevLauncherExpoActivityConfigurator.kt: (33, 49): 'constructor TaskDescription(String!, Bitmap!, Int)' is deprecated. Deprecated in Java
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/configurators/DevLauncherExpoActivityConfigurator.kt: (57, 61): 'FLAG_TRANSLUCENT_STATUS: Int' is deprecated. Deprecated in Java
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/configurators/DevLauncherExpoActivityConfigurator.kt: (87, 47): 'getter for systemUiVisibility: Int' is deprecated. Deprecated in Java
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/configurators/DevLauncherExpoActivityConfigurator.kt: (90, 70): 'SYSTEM_UI_FLAG_LIGHT_STATUS_BAR: Int' is deprecated. Deprecated in Java
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/configurators/DevLauncherExpoActivityConfigurator.kt: (94, 69): 'SYSTEM_UI_FLAG_LIGHT_STATUS_BAR: Int' is deprecated. Deprecated in Java
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/configurators/DevLauncherExpoActivityConfigurator.kt: (98, 69): 'SYSTEM_UI_FLAG_LIGHT_STATUS_BAR: Int' is deprecated. Deprecated in Java
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/configurators/DevLauncherExpoActivityConfigurator.kt: (102, 17): 'setter for systemUiVisibility: Int' is deprecated. Deprecated in Java
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/configurators/DevLauncherExpoActivityConfigurator.kt: (110, 59): 'FLAG_FULLSCREEN: Int' is deprecated. Deprecated in Java
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/configurators/DevLauncherExpoActivityConfigurator.kt: (111, 61): 'FLAG_FORCE_NOT_FULLSCREEN: Int' is deprecated. Deprecated in Java
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/configurators/DevLauncherExpoActivityConfigurator.kt: (113, 59): 'FLAG_FORCE_NOT_FULLSCREEN: Int' is deprecated. Deprecated in Java
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/configurators/DevLauncherExpoActivityConfigurator.kt: (114, 61): 'FLAG_FULLSCREEN: Int' is deprecated. Deprecated in Java
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/configurators/DevLauncherExpoActivityConfigurator.kt: (126, 23): 'replaceSystemWindowInsets(Int, Int, Int, Int): WindowInsets' is deprecated. Deprecated in Java
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/configurators/DevLauncherExpoActivityConfigurator.kt: (127, 25): 'getter for systemWindowInsetLeft: Int' is deprecated. Deprecated in Java
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/configurators/DevLauncherExpoActivityConfigurator.kt: (129, 25): 'getter for systemWindowInsetRight: Int' is deprecated. Deprecated in Java
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/main/java/expo/modules/devlauncher/launcher/configurators/DevLauncherExpoActivityConfigurator.kt: (130, 25): 'getter for systemWindowInsetBottom: Int' is deprecated. Deprecated in Java
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/release/java/expo/modules/devlauncher/DevLauncherController.kt: (92, 20): Parameter 'context' is never used
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/release/java/expo/modules/devlauncher/DevLauncherController.kt: (92, 38): Parameter 'reactNativeHost' is never used
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/release/java/expo/modules/devlauncher/DevLauncherController.kt: (98, 64): Parameter 'cazz' is never used
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/release/java/expo/modules/devlauncher/DevLauncherController.kt: (103, 35): Parameter 'reactActivity' is never used
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/release/java/expo/modules/devlauncher/DevLauncherController.kt: (108, 27): Parameter 'reactActivity' is never used
w: /Users/humad/Desktop/tvproject-mobile/node_modules/expo-dev-launcher/android/src/release/java/expo/modules/devlauncher/DevLauncherController.kt: (108, 57): Parameter 'intent' is never used

FAILURE: Build failed with an exception.

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

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 56s
512 actionable tasks: 512 executed

Snack or minimal code example

Package versions

name version
react-native 0.63.4
react-native-reanimated 2.3.0-beta.1 (but I’ve also tried with the latest version)
NodeJS 16.14
Xcode N/A
Java openjdk 11.0.11
Gradle 6.3
expo 42 (but I dont use it)

Affected platforms

  • Android
  • iOS
  • Web

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:20 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
xtdhwlcommented, Aug 17, 2022

主工程添加: //解决编译报错

rootProject.getSubprojects().forEach({ project ->
    if ("react-native-reanimated" == project.name) {
        project.tasks.withType(JavaCompile) {
            compileTask ->
                compileTask.dependsOn("applyJavaPatches")
        }
    }
})
2reactions
oleksandr-dziubancommented, Nov 4, 2022

Today the issue is active again on our CI… Yesterday all builds were green, but today without any changes builds fails.

Error is now reproducible for our project on CI for release Android build:

React v18.0.0 React Native v0.69.6 React Native Reanimated: v2.10.0

Task :react-native-reanimated:compileReleaseJavaWithJavac FAILED
/builds/engineering/mobile/live-investing-app/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
/builds/engineering/mobile/live-investing-app/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
  ^
/builds/engineering/mobile/live-investing-app/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.

Locally debug and release Android build works fine. Only when we build Android app on CI with cached npm modules it throws an error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Execution Failed for task :app:compileDebugJavaWithJavac in ...
In Android Studio 3.1, you can see the errors details in the Build window. Open up Build tab. They are somewhat hidden, you...
Read more >
Build and run your app - Android Developers
Learn how to quickly build and run your app on the Android emulator or a physical device.
Read more >
Gradle build fails with build tools 31.0.0 - Unity Forum
Android Gradle Plugin 4.0.1 used in all latest Unity 2020LTS, 2021.1 and 2021.2 versions does not work with Android SDK build-tools version ...
Read more >
task :app:compilereleasejavawithjavac failed - You.com
BlockI don't want to see this, for any search. Feedback. What do you think of this? Execution Failed for task :app:compileDebugJavaWithJavac in Android ......
Read more >
Visible to Public - Issue Tracker - Google
compile /min/target SDK version = android-N ... jack compiler enabled (in app module) ... P3, Android is not open Bluetooth 4.0 for developers....
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