构建Android gradle项目时出现问题:Task:buildSrc:compileGroovy常见问题

x759pob2  于 2024-01-06  发布在  Android
关注(0)|答案(1)|浏览(292)

我试图在我的Windows机器上构建一个Android SDK。我将Java升级到最新的64位JDK(21),当运行.\gradlew.bat core:assembleCoreDebug时,我得到这些错误。
如何解决?

  1. Picked up JAVA_TOOL_OPTIONS: -Dlog4j2.formatMsgNoLookups=true
  2. Starting a Gradle Daemon (subsequent builds will be faster)
  3. > Task :buildSrc:compileGroovy FAILED
  4. Picked up JAVA_TOOL_OPTIONS: -Dlog4j2.formatMsgNoLookups=true
  5. FAILURE: Build failed with an exception.
  6. * What went wrong:
  7. Execution failed for task ':buildSrc:compileGroovy'.
  8. > BUG! exception in phase 'semantic analysis' in source unit 'C:\Users\user\Downloads\mobile\android\buildSrc\src\main\groovy\Javadoc.groovy' Unsupported class file major version 65
  9. * Try:
  10. > Run with --stacktrace option to get the stack trace.
  11. > Run with --info or --debug option to get more log output.
  12. > Run with --scan to get full insights.
  13. * Get more help at https://help.gradle.org
  14. BUILD FAILED in 5s
  15. 1 actionable task: 1 executed

字符串

xxe27gdn

xxe27gdn1#

我所做的是删除以下文件夹:
1.第一个月

  1. .idea
  2. build
    然后同步和构建。

相关问题