如何解决这是我每次尝试运行 flutter 在 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
时会发生什么?希望它会引导您完成接受许可的步骤。
对于不受支持的类问题,运行 Gradle clean 是否可以解决问题?为此,您应该能够在命令行上导航到项目 android 目录并运行 gradlew clean
。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。