任务':react-native-async-storage_async-storage:compileDebugJavaWithJavac'执行失败

问题描述 投票:0回答:1

当我使用 Asyncstorage 时,当我运行 Android 时,当我卸载软件包然后构建成功时,我会收到此错误,任何人都可以帮助我该怎么办?


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: C:\Users\sinha\AppData\Local\Android\Sdk\platforms\android-34\core-for-system-modules.jar.
         > Error while executing process C:\Program Files\Java\jdk-21\bin\jlink.exe with arguments {--module-path C:\Users\sinha\.gradle\caches\transforms-3\39249073bb6a3501d7fccc77a4a99ba2\transformed\output\temp\jmod --add-modules java.base --output C:\Users\sinha\.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 38s

我正在使用最新版本的React naive

我正在使用最新版本的React naive

react-native asyncstorage
1个回答
0
投票

我也遇到过同样的问题,并通过仅保留 JDK 17 解决了该问题。它似乎已连接到 JDK,因此如果您安装了多个 JDK 版本,请删除额外的内容并仅保留必要的版本。

根据React Native文档,JDK 17是推荐版本。

© www.soinside.com 2019 - 2024. All rights reserved.