dart 任务“:app:processDebugManifest”的Flutter执行失败

vqlkdk9b  于 2023-06-19  发布在  Flutter
关注(0)|答案(2)|浏览(208)

x1c 0d1x我是Flutter的新手,起初我的项目运行良好,但突然我开始遇到这个问题:失败:生成失败,出现异常。

  • 哪里出错了:执行任务“:app:processDebugMainManifest”失败。

无法使字段private final java.lang.String java.io.File.path可访问:模块java.base不“打开java.io“到未命名的模块@1f05eb0a现在每当我运行项目或甚至我试图使新项目我得到这样的错误,我甚至尝试了可用的答案与此查询相关,但调试失败。下面是我Flutter版本:

PS C:\Work\t_post> flutter doctor -v
[√] Flutter (Channel stable, 2.2.2, on Microsoft Windows [Version 10.0.19042.1052], locale en-US)
    • Flutter version 2.2.2 at C:\Work\flutter
    • Framework revision d79295af24 (2 weeks ago), 2021-06-11 08:56:01 -0700
    • Engine revision 91c9fc8fe0
    • Dart version 2.13.3

[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at C:\Users\User\AppData\Local\Android\sdk
    • Platform android-30, build-tools 30.0.3
    • Java binary at: C:\Program Files\Java\jdk-16.0.1\bin\java
    • Java version Java(TM) SE Runtime Environment (build 16.0.1+9-24)
    • All Android licenses accepted.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[√] VS Code (version 1.57.1)
    • VS Code at C:\Users\User\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension version 3.23.0

[√] Connected device (3 available)
    • sdk gphone x86 arm (mobile) • emulator-5554 • android-x86    • Android 11 (API 30) (emulator)
    • Chrome (web)                • chrome        • web-javascript • Google Chrome 91.0.4472.124
    • Edge (web)                  • edge          • web-javascript • Microsoft Edge 91.0.864.54

! Doctor found issues in 1 category.

下面是我的pubspec.yaml文件:

name: t_post
description: A new Flutter project.

# The following line prevents the package from being accidentally published to
# pub.dev using `pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.0+1

environment:
  sdk: ">=2.12.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter

# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec

# The following section is specific to Flutter.
flutter:

  # The following line ensures that the Material Icons font is
  # included with your application, so that you can use the icons in
  # the material Icons class.
  uses-material-design: true
ovfsdjhp

ovfsdjhp1#

只是将JDK版本从16降级到15对我来说很有效。

zzzyeukh

zzzyeukh2#

删除Flutter项目上的Android文件夹,然后在终端中运行下面的命令。

flutter create --platforms=android .

这将解决此问题

相关问题