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
FAILURE: Build failed with an exception. * Where: Build file 'D:\test\flutter_shuqi\android\build.gradle' line: 30 * 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 'D:\test\flutter_shuqi\android\app\build.gradle' (C:\Users\Administrator\.gradle\caches\7.5\scripts\4rbckuc3szfal6js8flcsziii). > BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 65 * 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 698ms ┌─ Flutter Fix ──────────────────────────────────────────────────────────────────────────────────┐ │ [!] Your project's Gradle version is incompatible with the Java version that Flutter is using │ │ for Gradle. │ │ │ │ To fix this issue, first, check the Java version used by Flutter by running `flutter doctor │ │ --verbose`. │ │ │ │ Then, update the Gradle version specified in │ │ D:\test\flutter_shuqi\android\gradle\wrapper\gradle-wrapper.properties to be compatible with │ │ that Java version. See the link below for more information on compatible Java/Gradle versions: │ │ https://docs.gradle.org/current/userguide/compatibility.html#java │ │ │ │ │ └────────────────────────────────────────────────────────────────────────────────────────────────┘ Exception: Gradle task assembleDebug failed with exit code 1
项目构建失败,主要问题在于 Gradle 版本与 Flutter 用于 Gradle 的 Java 版本不兼容。
我这个问题是因为在配置flutter开发鸿蒙的时候 flutter doctor-v 报错 找不到android捆绑的java,为了解决这个问题就把jbr里面的内容复制,放到自己新建的jre里面了 所以jdk17和复制的jdk21冲突了
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 地球OL攻略 —— 某应届生求职总结
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 提示词工程——AI应用必不可少的技术
· .NET周刊【3月第1期 2025-03-02】