Android studio 在尝试运行 dart 文件时出现错误

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

Flutter Doctor 显示没有问题。

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: C:\Users\hp\AppData\Local\Android\Sdk\platforms\android-34\core-for-system-modules.jar.
         > Error while executing process C:\Program Files\Android\Android Studio\jbr\bin\jlink.exe with arguments {--module-path C:\Users\hp\.gradle\caches\8.10.2\transforms\b6cf251cc82e752815774f7238f512af-a8c332e2-4e5d-43fe-94a7-d7db463ed645\transformed\output\temp\jmod --add-modules java.base --output C:\Users\hp\.gradle\caches\8.10.2\transforms\b6cf251cc82e752815774f7238f512af-a8c332e2-4e5d-43fe-94a7-d7db463ed645\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 2m 6s
Error: Gradle task assembleDebug failed with exit code 1

在此输入图片描述

我期待代码能够顺利运行。

android flutter ladybug
1个回答
0
投票

您可以尝试的解决方案

flutter pub cache clean
然后按提示
y
然后
flutter pub get
您也可以尝试通过更改
connectivity_plus
 中的版本来升级 
pubspec.yaml

软件包
© www.soinside.com 2019 - 2024. All rights reserved.