升级开发环境后Flutter构建报错:无法解析androidJdkImage配置
Flutter升级Gradle后构建失败问题
升级配置
近期将Android Studio、Java版本及gradle-wrapper.properties中的Gradle版本升级至最新,配置如下:
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
构建错误日志
构建应用时出现以下错误:
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':connectivity_plus:compileDebugJavaWithJavac'. > Could not resolve all files for configuration ':connectivity_plus: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/..../Library/Android/sdk/platforms/android-34/core-for-system-modules.jar. > Error while executing process /Users/..../Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/jlink with arguments {--module-path /Users/malwinder/.gradle/caches/8.10.2/transforms/057cd3d70c61a40076a3bbfe497a8e16-0d4425f6-230d-4e42-a5da-d5def5f24a35/transformed/output/temp/jmod --add-modules java.base --output /Users/..../.gradle/caches/8.10.2/transforms/057cd3d70c61a40076a3bbfe497a8e16-0d4425f6-230d-4e42-a5da-d5def5f24a35/transformed/output/jdkImage --disable-plugin system-modules}
开发环境信息
Android Studio Ladybug | 2024.2.1 Build #AI-242.21829.142.2421.12409432, built on September 25, 2024 Runtime version: 21.0.3+-79915917-b509.11 aarch64 VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o. Toolkit: sun.lwawt.macosx.LWCToolkit macOS 15.0 GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation Memory: 4096M Cores: 8 Metal Rendering is ON Registry: ide.balloon.shadow.size=0 debugger.new.tool.window.layout=true ide.new.editor.tabs.vertical.borders=true ide.animate.toolwindows=true ide.experimental.ui=true ide.editor.tab.selection.animation=true i18n.locale= Non-Bundled Plugins: com.chylex.intellij.inspectionlens (1.4.1) com.jetbrains.gerryPurpleTheme (2024.1.0920) com.zll.format (2.2) IdeaVIM (2.16.0) dev.willebrands.intellij.sloppyfocus (0.9.0) Dart (242.21829.3) PlantUML integration (7.11.2-IJ2023.2) com.bloc.intellij_generator_plugin (4.0.2) com.flutter_create_stateful_widget (1.5) andrasferenczi.dart-data-plugin (0.2.0) com.markskelton.one-dark-theme (5.12.0) com.ankit.mahadik.json.dart.class (2.16) com.intellij.marketplace (242.21829.233) com.localizely.flutter-intl (1.18.5-2023.2) Key Promoter X (2024.2.0) com.herbert.george.dart.extensions (0.0.1+3) com.jiajun.flutter_add_image (1.7) com.shuzijun.markdown-editor (2.0.5) com.herbert.george.flutter-snippets (2.0.0-stable-1) com.eggnstone.jetbrainsplugins.DartFormat (2.0.20) Docker (242.21829.162) izhangzhihao.rainbow.brackets (2024.2.6-241) cn.yiiguxing.plugin.translate (3.6.6) pl.pszklarska.pubversionchecker (1.3.5) com.chrisrm.idea.MaterialThemeUI (9.5.0) com.developerphil.adbidea (1.6.18) com.github.kikimanjaro.stickyscroll (0.0.2) com.github.copilot (1.5.24.6927-nightly) org.intellij.qodana (242.21829.57) com.mallowigi (97.0.0) mobi.hsz.idea.gitignore (4.5.3) io.flutter (81.1.3) com.crzsc.FlutterAssetsGenerator (2.4.2) de.mariushoefler.flutter_enhancement_suite (1.7.1) com.ruiyu.ruiyu (5.2.1)
补充信息
- 操作系统:MacOS Sequoia(Version 15.0)
- 问题定位:推测该问题与
connectivity_plus包相关,可参考该包的官方文档及fluttercommunity/plus_plugins仓库的Issue #3299。
内容的提问来源于stack exchange,提问作者Malwinder Singh
相关产品推荐
相关产品推荐

