[英]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.