Could not resolve all files for configuration

文章描述了一名开发者在升级第三方SDK版本后遇到编译错误的过程,通过排查发现是由于Gradle版本不兼容导致。解决方法是将Gradle版本对齐并清理缓存。
摘要由CSDN通过智能技术生成

关于作者: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).

二、概览

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


FAILURE: Build completed with 9 failures.

1: Task failed with an exception.
-----------
* What went wrong:
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).
        Searched in the following locations:
            https://maven.aliyun.com/nexus/content/groups/public/xxxisk-4.3.1.8.aar
            https://maven.aliyun.com/nexus/content/groups/public/xxxisk-4.3.1.8.jar

* 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 49s

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.5.1/userguide/command_line_interface.html#sec:command_line_warnings
182 actionable tasks: 164 executed, 18 up-to-date
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

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

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

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

三、 推荐阅读

Java 专栏

SQL 专栏

数据结构与算法

Android学习专栏

未经允许不得转载

ddd

  • 14
    点赞
  • 19
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 8
    评论
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Android西红柿

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值