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' continued #1099

Open almercier opened 3 weeks ago

almercier commented 3 weeks ago

What happened?

Continuation of https://github.com/react-native-async-storage/async-storage/issues/1081

The comments/solution state to use JDK 17, but I am still receiving this error even with JDK 17 in both my CLI Path and Android studio. Using JDK 17.0.11, react-native 0.74.1, and @react-native-async-storage/async-storage 1.23.1

> Task :react-native-async-storage_async-storage:compileDebugJavaWithJavac FAILED
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':react-native-async-storage_async-storage:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':react-native-async-storage_async-storage: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/x/Library/Android/sdk/platforms/android-34/core-for-system-modules.jar.
         > Error while executing process /Users/x/Library/Java/JavaVirtualMachines/graalvm-jdk-17.0.11/Contents/Home/bin/jlink with arguments {--module-path /Users/x/.gradle/caches/transforms-4/4cbcbed5d357f3262b54a00ae7658940-0a207e5a-55ce-4091-9e90-6a293f6ff06d/transformed/output/temp/jmod --add-modules java.base --output /Users/x/.gradle/caches/transforms-4/4cbcbed5d357f3262b54a00ae7658940-0a207e5a-55ce-4091-9e90-6a293f6ff06d/transformed/output/jdkImage --disable-plugin system-modules}

image

image

Version

1.23.1

What platforms are you seeing this issue on?

System Information

System:
  OS: macOS 14.1.2
  CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
  Memory: 36.39 MB / 16.00 GB
  Shell:
    version: "5.9"
    path: /bin/zsh
Binaries:
  Node:
    version: 18.16.0
    path: ~/.nvm/versions/node/v18.16.0/bin/node
  Yarn:
    version: 1.22.21
    path: ~/.nvm/versions/node/v18.16.0/bin/yarn
  npm:
    version: 9.5.1
    path: ~/.nvm/versions/node/v18.16.0/bin/npm
  Watchman:
    version: 2022.09.19.00
    path: /usr/local/bin/watchman
Managers:
  CocoaPods:
    version: 1.15.2
    path: /usr/local/bin/pod
SDKs:
  iOS SDK:
    Platforms:
      - DriverKit 23.4
      - iOS 17.4
      - macOS 14.4
      - tvOS 17.4
      - visionOS 1.1
      - watchOS 10.4
  Android SDK:
    API Levels:
      - "26"
      - "29"
      - "33"
      - "34"
    Build Tools:
      - 28.0.3
      - 29.0.2
      - 30.0.2
      - 30.0.3
      - 32.0.0
      - 32.1.0
      - 33.0.0
      - 33.0.1
      - 34.0.0
    System Images:
      - android-33 | Intel x86_64 Atom
      - android-33 | Google APIs ARM 64 v8a
      - android-33 | Google APIs Intel x86_64 Atom
      - android-34 | Google Play Intel x86_64 Atom
    Android NDK: Not Found
IDEs:
  Android Studio: 2023.3 AI-233.14808.21.2331.11709847
  Xcode:
    version: 15.3/15E204a
    path: /usr/bin/xcodebuild
Languages:
  Java:
    version: 17.0.11
    path: /usr/bin/javac
  Ruby:
    version: 2.6.10
    path: /usr/bin/ruby
npmPackages:
  "@react-native-community/cli": Not Found
  react:
    installed: 18.3.1
    wanted: ^18.3.1
  react-native:
    installed: 0.74.1
    wanted: 0.74.1
  react-native-macos: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: true
  newArchEnabled: false
iOS:
  hermesEnabled: true
  newArchEnabled: false

Steps to Reproduce

Create new base react-native project and attempt to install react-native-async-storage

krizzu commented 3 weeks ago

Hey, have you tried different JDK distribution? I see you use graal and quick search shows there might be some issues with jlink, but might not be related to your case.

almercier commented 3 weeks ago

@krizzu

I'm Getting the same using Zulu

image

krizzu commented 3 weeks ago

But that's different error, right? Have u cleared build before?