构建失败并出现异常。不支持共享首选项包

问题描述 投票:0回答:1
 Build failed with an exception.

* What went wrong:
Execution failed for task ':shared_preferences_android:compileDebugJavaWithJavac'.
> Could not resolve all files for configuration ':shared_preferences_android: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: /home/yeejai-lap-4/Android/Sdk/platforms/android-34/core-for-system-modules.jar.
         > Error while executing process /opt/android-studio/jbr/bin/jlink with arguments {--module-path /home/yeejai-lap-4/.gradle/caches/transforms-3/4a46fc89ed5f9adfe3afebf74eb8bfeb/transformed/output/temp/jmod --add-modules java.base --output /home/yeejai-lap-4/.gradle/caches/transforms-3/4a46fc89ed5f9adfe3afebf74eb8bfeb/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 15s
Error: Gradle task assembleDebug failed with exit code 1

Dart SDK 版本:3.5.4(稳定)(2024 年 10 月 16 日星期三 16:18:51 +0000)在“linux_x64”上,这是我的 Flutter 3.24.5 • 频道 [用户分支] • 未知源框架 • 修订版 dec2ee5c1f ( 8 周前) • 2024-11-13 11:13:06 -0800 引擎 • 修订版 a18df97ca5 工具 • Dart 3.5.4 • DevTools 2.37.3 flutter 版本和 openjdk 17.0.13 2024-10-15 OpenJDK 运行时环境(内部版本 17.0.13+11-Ubuntu-2ubuntu120.04) OpenJDK 64 位服务器虚拟机(构建17.0.13+11-Ubuntu-2ubuntu120.04,混合模式,共享)这是我的java版本,我需要使用哪个版本共享首选项哪个版本适合这些所有版本

java flutter dart
1个回答
0
投票

在 settings.gradle 文件中我应用了以下更改, id“com.android.application”版本“8.3.2”适用 false id“org.jetbrains.kotlin.android”版本“2.0.20”适用 false(这对我有用)

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