繁体   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

这不是它。 我已经安装了 android studio 仍然是我的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.

对于 Android 许可证问题,在命令行上运行flutter doctor --android-licenses会发生什么? 希望它会引导您完成接受许可证的步骤。

对于不受支持的 class 问题,运行 Gradle 是否可以解决问题? 为此,您应该能够在命令行上导航到项目 android 目录并运行gradlew clean

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM