react-native-community_datetimepicker : compileDebugJavaWithJavac FAILED

231 Views Asked by At

It seems to be a compatibility issue. Kottlin & Java

But I don't know how to solve it.

React native cli version is 0.73.0

"@react-native-community/datetimepicker": "^7.6.2",
"react": "18.2.0",
"react-native": "0.73.0",
"react-native-modal-datetime-picker": "^17.1.0",

I did "npm run android". The error message is as follows.

[email protected] android react-native run-android

info A dev server is already running for this project on port 8081. info Installing the app...

Task :@react-native-community_datetimepicker:compileDebugJavaWithJavac FAILED

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

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

For more on this, please refer to https://docs.gradle.org/8.3/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. 13 actionable tasks: 1 executed, 12 up-to-date

info Tip: Make sure that you have set up your development environment correctly, by running npx react-native doctor. To read more about doctor command visit: https://github.com/react-native-community/cli/blob/main/packages/cli-doctor/README.md#doctor

FAILURE: Build failed with an exception.

  • What went wrong: Execution failed for task ':@react-native-community_datetimepicker:compileDebugJavaWithJavac'.

Could not resolve all files for configuration ':@react-native-community_datetimepicker: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/kwonheejung/Library/Android/sdk/platforms/android-34/core-for-system-modules.jar. > Error while executing process /Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home/bin/jlink with arguments {--module-path /Users/kwonheejung/.gradle/caches/transforms-3/39249073bb6a3501d7fccc77a4a99ba2/transformed/output/temp/jmod --add-modules java.base --output /Users/kwonheejung/.gradle/caches/transforms-3/39249073bb6a3501d7fccc77a4a99ba2/transformed/output/jdkImage --disable-plugin system-modules}

  • 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.

BUILD FAILED in 2s 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-community_datetimepicker:compileDebugJavaWithJavac'.

Could not resolve all files for configuration ':@react-native-community_datetimepicker: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/kwonheejung/Library/Android/sdk/platforms/android-34/core-for-system-modules.jar. > Error while executing process /Library/Java/JavaVirtualMachines/jdk-21.jdk/Contents/Home/bin/jlink with arguments {--module-path /Users/kwonheejung/.gradle/caches/transforms-3/39249073bb6a3501d7fccc77a4a99ba2/transformed/output/temp/jmod --add-modules java.base --output /Users/kwonheejung/.gradle/caches/transforms-3/39249073bb6a3501d7fccc77a4a99ba2/transformed/output/jdkImage --disable-plugin system-modules} * 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. BUILD FAILED in 2s. info Run CLI with --verbose flag for more details.

1

There are 1 best solutions below

0
famfamfam On

this problem will gone after downgrate React Native version to 0.72.x