简体   繁体   English

Gradle 构建失败,并显示“无法解析 class:ExtraModelBuilder”

[英]Gradle build fails with "unable to resolve class: ExtraModelBuilder"

I would like to start programming an android application.我想开始编写 android 应用程序。 I am following a tutorial etc. and when in the background gradle tries to build the project I get an error:我正在关注教程等,当在后台 gradle 尝试构建项目时出现错误:

Starting Gradle Daemon...
Gradle Daemon started in 2 s 153 ms
 
FAILURE: Build failed with an exception.
 
* Where:
Initialization script 'C:\Users\***\AppData\Local\Temp\ijinit.gradle' line: 4
 
* What went wrong:
Could not compile initialization script 'C:\Users\***\AppData\Local\Temp\ijinit.gradle'.
> startup failed:
  initialization script 'C:\Users\***\AppData\Local\Temp\ijinit.gradle': 4: unable to resolve class org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilder
   @ line 4, column 1.
     import org.jetbrains.plugins.gradle.tooling.internal.ExtraModelBuilder
     ^
 
  1 error

Full exception details: https://pastebin.com/jqQkycLc完整的异常细节: https://pastebin.com/jqQkycLc

I have Android Studio version 2021.3.1 (the latest) and I just started my project (I just added strings in strings.xml)我有 Android Studio 版本 2021.3.1(最新),我刚刚开始我的项目(我刚刚在 strings.xml 中添加了字符串)

Thanks for your help!谢谢你的帮助!

I don't need any more help.我不再需要任何帮助。 I've put an ndk in and fiddled around with the versions (looking at the compatibilities on the wiki) and everything works.我已经放入了一个 ndk 并摆弄了这些版本(查看 wiki 上的兼容性)并且一切正常。 I'll be able to resume watching your tutorial!我将能够继续观看您的教程! Thank to @cactustictacs!感谢@cactustictacs!

The actual answer appears to be: upgrade to Gradle 7.2, as it is suggested here .实际答案似乎是:按照此处的建议升级到 Gradle 7.2。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM