我得到了答案。。您应该删除flutter SDK并重新安装它。然后通过对其进行最后一次更新
当我运行应用程序时,会显示以下错误消息:
Launching libmain.dart on AOSP on IA Emulator in debug mode…
libmain.dart
FAILURE: Build failed with an exception.
What went wrong:
Could not open settings remapped class cache for bq3hllkgb26p0nrblf5gh8d37 (C:Usersamabd.gradlecaches5.6.2scripts-remappedsettings_dok3hc1t57922ptib73pz9y10bq3hllkgb26p0nrblf5gh8d37settings8410a2d21ed2f87c8a0398566330ee52).
Could not open settings generic class cache for settings file ‘D:projectsflutterphotophotosandroidsettings.gradle’ (C:Usersamabd.gradlecaches5.6.2scriptsbq3hllkgb26p0nrblf5gh8d37settingssettings8410a2d21ed2f87c8a0398566330ee52).
BUG! exception in phase ‘semantic analysis’ in source unit ‘BuildScript’ Unsupported class file major version 57
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 3s
Exception: Gradle task assembleDebug failed with exit code 1
Exited (sigterm)
有人能帮我解决这个问题吗?
转到该文件夹并删除所有缓存的文件。
C:Usersamabd.gradlecaches
然后尝试重新启动项目。
flutter upgrade
经过数小时的搜索和删除android工作室后,我也遇到了同样的问题。我将java降级为java-8,并在操作系统中设置java_home,它就像一个魅力。