未找到com.android.tools.build:gradle:7.4.0的匹配变体

刚在github克隆了个项目,结果直接弹出错误:

  1. > No matching variant of com.android.tools.build:gradle:7.4.0 was found. The consumer was configured to find a runtime of a library compatible with Java 8, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.5' but:
  2. - Variant 'apiElements' capability com.android.tools.build:gradle:7.4.0 declares a library, packaged as a jar, and its dependencies declared externally:
  3. - Incompatible because this component declares an API of a component compatible with Java 11 and the consumer needed a runtime of a component compatible with Java 8
  4. - Other compatible attribute:
  5. - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')
  6. - Variant 'javadocElements' capability com.android.tools.build:gradle:7.4.0 declares a runtime of a component, and its dependencies declared externally:
  7. - Incompatible because this component declares documentation and the consumer needed a library
  8. - Other compatible attributes:
  9. - Doesn't say anything about its target Java version (required compatibility with Java 8)
  10. - Doesn't say anything about its elements (required them packaged as a jar)
  11. - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')
  12. - Variant 'runtimeElements' capability com.android.tools.build:gradle:7.4.0 declares a runtime of a library, packaged as a jar, and its dependencies declared externally:
  13. - Incompatible because this component declares a component compatible with Java 11 and the consumer needed a component compatible with Java 8
  14. - Other compatible attribute:
  15. - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')
  16. - Variant 'sourcesElements' capability com.android.tools.build:gradle:7.4.0 declares a runtime of a component, and its dependencies declared externally:
  17. - Incompatible because this component declares documentation and the consumer needed a library
  18. - Other compatible attributes:
  19. - Doesn't say anything about its target Java version (required compatibility with Java 8)
  20. - Doesn't say anything about its elements (required them packaged as a jar)
  21. - Doesn't say anything about org.gradle.plugin.api-version (required '7.5')

最终将Gradle JDK更改为11。
文件-〉设置-〉构建、执行、部署-〉构建工具-〉Gradle

选择JDK 11即可,如果没有选项,试着打开项目的build.gradle,右上角应该会提示安装amazon....jdk 11等类似的东西,安装后按照上面的选择然后编译即可

返回神马指导员首页>>

转载出处标题:未找到com.android.tools.build:gradle:7.4.0的匹配变体

网站链接:https://www.smzdy.com/blog/24333.html

免责声明:根据《计算机软件保护条例》第十七条规定“为了学习和研究软件内含的设计思想和原理,通过安装、显示、传输或者存储软件等方式使用软件的,可以不经软件著作权人许可,不向其支付报酬。”
本站所发布的一切Windows教程,教程文章,破解补丁、注册机和注册信息及软件的文章等图文资源仅限用于学习和研究目的;本站并不贩卖软件,不存在任何商业目的及用途,网站会员捐赠是您喜欢本站而产生的赞助支持行为,仅为维持服务器的开支与维护,全凭自愿无任何强求。你不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。
本站信息来自网络,不承担任何由于内容的版权、合法性等所引起的争议与法律责任!您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。访问和下载本站内容,说明您已同意上述条款。
本站为个人博客非盈利性站点,所有软件信息均来自网络,所有资源仅供学习参考研究目的。如您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。本站如果侵犯你的利益,携带权利证明请发送邮箱到 s7web888#gmail.com,我们会很快的为您处理。

发表回复

登录后才能评论