Could not resolve all files for configuration

深碍√TFBOYSˉ_ 2024-05-28 10:02 182阅读 0赞

关于作者:CSDN内容合伙人、技术专家, 从零开始做日活千万级APP。
专注于分享各领域原创系列文章 ,擅长java后端、移动开发、商业变现、人工智能等,希望大家多多支持。
未经允许不得转载

目录

  • 一、导读
  • 二、概览
  • 三、 推荐阅读

在这里插入图片描述

一、导读

我们继续总结学习开发中遇到的问题,温故知新,避免跳坑里。

今天遇到一个编译问题,打包就失败,比较坑,在此做一个记录,防止掉坑。

本文记录一次解决的过程,

Execution failed for task ‘:app:checkReleaseDuplicateClasses’.

Could not resolve all files for configuration ‘:appReleaseRuntimeClasspath’.

Failed to transform xxx-4.3.1.8.aar (com.txxx:xxx:4.3.1.8) to match attributes {artifactType=enumerated-runtime-classes, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.

Could not find xxx-4.3.1.8.aar (com.xxx:xxx:4.3.1.8).

二、概览

背景是这样的,一直都编译的好好的项目突然报错,报错日志如下:

  1. FAILURE: Build completed with 9 failures.
  2. 1: Task failed with an exception.
  3. -----------
  4. * What went wrong:
  5. Execution failed for task ':app:checkReleaseDuplicateClasses'.
  6. > Could not resolve all files for configuration ':appReleaseRuntimeClasspath'.
  7. > Failed to transform xxx-4.3.1.8.aar (com.txxx:xxx:4.3.1.8) to match attributes {
  8. artifactType=enumerated-runtime-classes, org.gradle.category=library, org.gradle.libraryelements=jar, org.gradle.status=release, org.gradle.usage=java-runtime}.
  9. > Could not find xxx-4.3.1.8.aar (com.xxx:xxx:4.3.1.8).
  10. Searched in the following locations:
  11. https://maven.aliyun.com/nexus/content/groups/public/xxxisk-4.3.1.8.aar
  12. https://maven.aliyun.com/nexus/content/groups/public/xxxisk-4.3.1.8.jar
  13. * Try:
  14. > Run with --stacktrace option to get the stack trace.
  15. > Run with --info or --debug option to get more log output.
  16. > Run with --scan to get full insights.
  17. ==============================================================================
  18. * Get more help at https://help.gradle.org
  19. BUILD FAILED in 49s
  20. Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
  21. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
  22. See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
  23. 182 actionable tasks: 164 executed, 18 up-to-date
  24. 14:29:31: Execution finished 'assembleFastreaderRelease'.

后来想了想,原因是我升级了一个三方sdk的版本号,4.3.1.6 -> 4.3.1.8 , 也就升级了下版本,咋就下载不了呢?
我们正常点aar的链接是可以正常下载包的, 于是我用三方的demo打包试了试,发现他们可以下载,正常打包,经过排查,
发现是gradle版本不一样,

于是,将版本号改成一样,就能正常下载了,还真tn的神奇,当然也没去细究为啥这样。

gradle-7.5.1-bin.zip -> gradle-7.6.2-bin.zip

  1. distributionBase=GRADLE_USER_HOME
  2. distributionPath=wrapper/dists
  3. zipStoreBase=GRADLE_USER_HOME
  4. zipStorePath=wrapper/dists
  5. distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip

当然在build前,最好清理一下缓存。

当然原因是多种多样的,大家可以慢慢尝试。

三、 推荐阅读

Java 专栏

SQL 专栏

数据结构与算法

Android学习专栏

未经允许不得转载

ddd

发表评论

表情:
评论列表 (有 0 条评论,182人围观)

还没有评论,来说两句吧...

相关阅读