ANDROID STUDIO 3.0 upgrade : Error:Could not resolve all files for configuration ':app:xxxxxxxDebugCompileClasspath'

ANDROID STUDIO 3.0 upgrade : Error:Could not resolve all files for configuration ':app:xxxxxxxDebugCompileClasspath'

我在升级最新的 android studio 稳定版后发现了这个警告

错误:无法解析配置“:app:xxxxxxxDebugCompileClasspath”的所有文件。

Failed to transform file 'commons-lang-2.4.jar' to match attributes {artifactType=android-classes} using transform JarTransform Transform output file xxxxxxx/xxxxxxx/xxxxxxx/app/commons-lang-2.4.jar does not exist.

这里是 gradle 和 gradle 包装版本:

gradle : classpath 'com.android.tools.build:gradle:3.0.0'

gradle 包装器 :

distributionUrl=https\://services.gradle.org/distributions/g‌​radle-4.1-all.zip

将项目 Gradle 的类路径更改为:

 classpath 'com.android.tools.build:gradle:3.1.0-alpha01'

将 gradle-wrapper.properties 的 distributionUrl 更改为

distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip

希望对你有帮助

更改依赖声明

来自

compile files('libs/commons-lang-2.4.jar')

implementation files('libs/commons-lang-2.4.jar')

我遇到了同样的问题,构建 -> 清理项目对我有用。

我遇到了同样的问题,用谷歌搜索了很多但没有任何效果。以下为我在 Android 4.2.1

上工作

Go to File -> Manage IDE Settings -> Restore IDE Settings

然后按照说明操作。