react-native-async-storage / async-storage

An asynchronous, persistent, key-value storage system for React Native.
https://react-native-async-storage.github.io/async-storage/
MIT License
4.61k stars 458 forks source link

Execution failed for task ':react-native-async-storage_async-storage:compileDebugJavaWithJavac'. #1081

Closed mayurmudoi closed 2 months ago

mayurmudoi commented 2 months ago

What happened?

Version

1.23.1

What platforms are you seeing this issue on?

System Information

info Fetching system and libraries information...
(node:17443) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
System:
  OS: Linux 6.5 Ubuntu 22.04.3 LTS 22.04.3 LTS (Jammy Jellyfish)
  CPU: (8) x64 Intel(R) Core(TM) i5-10300H CPU @ 2.50GHz
  Memory: 2.91 GB / 7.59 GB
  Shell:
    version: 5.1.16
    path: /bin/bash
Binaries:
  Node:
    version: 21.5.0
    path: ~/.nvm/versions/node/v21.5.0/bin/node
  Yarn:
    version: 1.22.19
    path: /usr/bin/yarn
  npm:
    version: 10.2.4
    path: ~/.nvm/versions/node/v21.5.0/bin/npm
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
IDEs:
  Android Studio: Not Found
Languages:
  Java:
    version: 17.0.10
    path: /usr/bin/javac
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.2.0
    wanted: 18.2.0
  react-native:
    installed: 0.73.3
    wanted: ^0.73.3
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: Not found
  newArchEnabled: false

info React Native v0.73.6 is now available (your project is running on v0.73.3).

Steps to Reproduce

gets this issue whenever i start my project

feri-irawan commented 2 months ago

Same issue here

mayurmudoi commented 2 months ago

Same issue here

Set the android studio and JDK Path properly. I was facing issue with my JDK as i was having two JDKs in system and the PATH wasn't set properly, after removing the JDK 21 (currently using JDK 17) and setting the path , it's working fine. I hope it works.

krizzu commented 2 months ago

This might come in handy: https://developer.android.com/build/jdks

feri-irawan commented 2 months ago

Same issue here

Set the android studio and JDK Path properly. I was facing issue with my JDK as i was having two JDKs in system and the PATH wasn't set properly, after removing the JDK 21 (currently using JDK 17) and setting the path , it's working fine. I hope it works.

Downgrade to JDK 17, works! Thanks bro!

almercier commented 3 weeks ago

I'm still getting this error using java 17, react-native 0.74.1, and @react-native-async-storage/async-storage 1.23.1. Verified that the jdk in both the path and android studio should be using 17...

image image