Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

react-native-reanimated:compileDebugJavaWithJavac #5855

Open
moloudayat opened this issue Mar 31, 2024 · 7 comments
Open

react-native-reanimated:compileDebugJavaWithJavac #5855

moloudayat opened this issue Mar 31, 2024 · 7 comments
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android

Comments

@moloudayat
Copy link

Description

Hi. I hope you are doing well. I have a problem on Android for react-native: 0.73.6 and react-native-reanimated: 3.8.1. I did all the configuration related to installing react-native-reanimated and it is working fine on iOS. However, I get this error on Android:

error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong:
Execution failed for task ':react-native-reanimated:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':react-native-reanimated:androidJdkImage'. > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}. > Execution failed for JdkImageTransform: /Users/moloud/Library/Android/sdk/platforms/android-34/core-for-system-modules.jar. > Error while executing process /Library/Java/JavaVirtualMachines/jdk-22.jdk/Contents/Home/bin/jlink with arguments {--module-path /Users/moloud/.gradle/caches/transforms-3/85b37ce8ffd30370fa8ec836992f9127/transformed/output/temp/jmod --add-modules java.base --output /Users/moloud/.gradle/caches/transforms-3/85b37ce8ffd30370fa8ec836992f9127/transformed/output/jdkImage --disable-plugin system-modules}
Screenshot 2024-03-31 at 6 14 49 PM

I am using JDK 7 for my Android

Steps to reproduce

  1. yarn add react-native-reanimated
  2. babel.config.js:
  presets: ['module:@react-native/babel-preset'],
  plugins: [
    'react-native-reanimated/plugin',
  ],
}; 
  1. sync Android Studio No Error, Warning ,or Problems
  2. npx react-native run-android
  3. yarn start --reset-cache

Snack or a link to a repository

https://github.com/software-mansion/react-native-reanimated

Reanimated version

3.8.1

React Native version

0.73.6

Platforms

Android

JavaScript runtime

None

Workflow

None

Architecture

None

Build type

None

Device

None

Device model

No response

Acknowledgements

Yes

@github-actions github-actions bot added Platform: Android This issue is specific to Android Missing repro This issue need minimum repro scenario labels Mar 31, 2024
Copy link

Hey! 👋

The issue doesn't seem to contain a minimal reproduction.

Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

@johanmey46
Copy link

I experience the same issue. As soon as I uninstall reanimated the app runs. I have tried multiple things such as a clean application but as soon as reanimated gets installed i get this issue.

@muhammadalizkhan
Copy link

I am Facing Same Issue, in Babbel file, presets: ['module:@react-native/babel-preset'],
plugins: [
'react-native-reanimated/plugin',
],
};

@johanmey46
Copy link

Thanks for the reply. I have already included this in my babel file, before I posted my problem.

@jeresig
Copy link

jeresig commented Apr 6, 2024

I was seeing the same issue.

Execution failed for task ':react-native-reanimated:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':react-native-reanimated:androidJdkImage'.
   > Failed to transform core-for-system-modules.jar to match attributes {artifactType=_internal_android_jdk_image, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
      > Execution failed for JdkImageTransform: /Users/jeresig/Library/Android/sdk/platforms/android-34/core-for-system-modules.jar.
         > Error while executing process /opt/homebrew/Cellar/openjdk/21.0.2/libexec/openjdk.jdk/Contents/Home/bin/jlink with arguments {--module-path /Users/jeresig/.gradle/caches/transforms-3/7192f249eae24284e999d3715d8b0aff/transformed/output/temp/jmod --add-modules java.base --output /Users/jeresig/.gradle/caches/transforms-3/7192f249eae24284e999d3715d8b0aff/transformed/output/jdkImage --disable-plugin system-modules}

Android gradle plugin: 8.1.1
Gradle: 8.3
React Native: 0.73.6
React Native Reanimated: 3.8.1
Android, openjdk: 21.0.2

I manually ran the failing command and saw:

Error: jdk.tools.jlink.plugin.PluginException: ModuleTarget is malformed: platformString missing delimiter: android

This led me to some posts talking about incompatibility of openjdk v21. I followed the instructions here and downgraded to openjdk v17: https://docs.expo.dev/guides/local-app-development/#prerequisites and now the build works for me.

@hiagoLF
Copy link

hiagoLF commented Apr 25, 2024

this solution worked to me on RN 0.74.0

#5927 (comment)

@Akakiiy
Copy link

Akakiiy commented Apr 26, 2024

RN - 0.74.0
Use rc release: "react-native-reanimated": "^3.9.0-rc.1" (#5927 (comment))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Missing repro This issue need minimum repro scenario Platform: Android This issue is specific to Android
Projects
None yet
Development

No branches or pull requests

6 participants