flutter_trip 无法运行

来源:8-2 APP首页框架搭建-Scaffold与PageView【搭了个框架】

qq_青鸟_17

2024-04-20

我在android studio上试图运行flutter_trip项目时,直接点击运行报错

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Unable to make field private final java.lang.String java.io.File.path accessible: module java.base does not "opens java.io" to unnamed module @6d9a28c8

* 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 9s
Exception: Gradle task assembleDebug failed with exit code 1

但我用android studio 单独打开flutter_trip 中的android项目,是可以运行的,请问有什么办法让其在flutter_trip 中也可以运行?

flutter版本:

Flutter 3.16.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 9e1c857886 (5 months ago) • 2023-11-30 11:51:18 -0600
Engine • revision cf7a9d0800
Tools • Dart 3.2.2 • DevTools 2.28.3

java 版本信息:

openjdk 11.0.22 2024-01-16 LTS

Android studio 版本信息:

Android Studio Flamingo | 2022.2.1 Canary 11
Build #AI-222.4459.24.2221.9445173, built on December 30, 2022
Runtime version: 17.0.4.1+0-b2043.56-9127311 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Windows 10 10.0
GC: G1 Young Generation, G1 Old Generation
Memory: 1280M
Cores: 8
Registry:
external.system.auto.import.disabled=true
ide.text.editor.with.preview.show.floating.toolbar=false
gradle.version.catalogs.dynamic.support=true

Non-Bundled Plugins:
com.github.copilot (1.4.6.4092)
PlantUML integration (6.5.0-IJ2022.2)
Dart (222.4582)
io.flutter (76.3.1)
com.crzsc.FlutterAssetsGenerator (2.4.2)
ASM Bytecode Viewer Support Kotlin (1.1)

写回答

1回答

CrazyCodeBoy

2024-04-22

在flutter项目的根目录下执行下flutter clean
然后再运行试试
0
0

Flutter从入门到进阶 实战携程网App 一网打尽核心技术

解锁Flutter开发新姿势,,系统掌握Flutter开发核心技术。

4788 学习 · 3270 问题

查看课程