简体   繁体   English

这是我每次尝试运行 flutter 在 main.dart 中提供的代码时遇到的错误

[英]this is the error I am getting every time I try to run the code that flutter provides in main.dart

    FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\devsh\Desktop\programs_\StudioProjects\untitled\android\build.gradle' line: 24

* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
   > Could not open proj generic class cache for build file 'C:\Users\devsh\Desktop\programs_\StudioProjects\untitled\android\app\build.gradle' (C:\Users\devsh\.gradle\caches\6.7\scripts\67wpoy60578g543vmv9v5k2r9).
      > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 60

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

and this is not it.这不是它。 I have installed android studio still my flutter doctor shows me that I haven't installed it yet and also there is some license issue I don't know how to solve我已经安装了 android studio 仍然是我的flutter doctor告诉我我还没有安装它而且还有一些许可证问题我不知道如何解决

this is my result of flutter doctor这是我的flutter doctor的结果

C:\Users\devsh>flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.6, on Microsoft Windows [Version 10.0.19042.985], locale en-IN)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[!] Android Studio (not installed)
[√] VS Code (version 1.55.2)
[√] Connected device (2 available)

! Doctor found issues in 3 categories.

For the Android license issue, what happens when you run flutter doctor --android-licenses on the command line?对于 Android 许可证问题,在命令行上运行flutter doctor --android-licenses会发生什么? Hopefully, it'll run you through the steps to accept the licenses.希望它会引导您完成接受许可证的步骤。

For the unsupported class issue, does running a Gradle clean solve the problem?对于不受支持的 class 问题,运行 Gradle 是否可以解决问题? To do this, you should be able to navigate to the projects android directory on the command line and run gradlew clean .为此,您应该能够在命令行上导航到项目 android 目录并运行gradlew clean

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 每次我尝试运行我的应用程序时,我都会收到“运行 'main.dart' 时出错:入口点不在 Flutter 根目录内” - i get "Error running 'main.dart': Entrypoint isn't within a Flutter pub root" every time i try to run my app 我已经实现了连接和提供者 package 但我在 main.dart 中收到以下错误 - I have implemented connectivity and provider package but I am getting the below error in main.dart 我正在尝试通过 VS 代码在模拟器上运行我的 flutter 应用程序,但收到错误消息,说它找不到我的 main.dart 文件的路径 - I'm trying to run my flutter app on an emulator from VS code and I get an error saying it cannot find the path to my main.dart file 我正在尝试通过 main.dart 通过开始屏幕导航主屏幕,但无法导航。 我是新来的,无法理解这个错误。 PL - I am trying to navigate home screen via Start screen through main.dart but failed to navigate. I am new to flutter and can't understand this error. Pl Flutter main.dart 中的 LateInitialization 错误 - LateInitialization Error In Flutter main.dart ZC047B10EEEE763AFB6164E07CF1CC268Z:我更改了Z35900D987289A89A83AF101D18A9F7C3501Z入口处login.zbbbb14127678960e171777897d8739501595015950101595010150150150150101010101010101010101010101010年, - Flutter: I have changed the Dart entrypoint to Login.dart , while building apks error shows that lib\main.dart not found 我如何将 main.dart 中的变量访问到颤振中的其他页面,我正在使用 Getx 状态管理 - How can i access to a variable in main.dart to other pages in flutter, i am using Getx state management 为什么我每次在手机上运行新的 flutter 代码时都会得到默认的 flutter 示例代码? - Why am i getting the default flutter example code every time i run my new flutter code on my phone? Flutter,android工作室。 main.dart 文件每次运行都会打开 - Flutter, android studio. main.dart file opens every run 出现“找不到目标文件”lib\main.dart“之类的错误。” 在 flutter 中构建 APK - Getting error like “Target file ”lib\main.dart“ not found.” whlie building APK in flutter
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM