问题
I found this warning after upgrading the latest android studio stable version
Error:Could not resolve all files for configuration ':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.
here is gradle and gradle wrapper versions :
gradle : classpath 'com.android.tools.build:gradle:3.0.0'
and
gradle wrapper :
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
回答1:
change dependency declaration
from
compile files('libs/commons-lang-2.4.jar')
to
implementation files('libs/commons-lang-2.4.jar')
回答2:
Change the classpath of Project Gradle to:
classpath 'com.android.tools.build:gradle:3.1.0-alpha01'
OR
change distributionUrl of gradle-wrapper.properties to
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
Hope it helps you
回答3:
I had the same problem, build -> clean project worked for me.
来源:https://stackoverflow.com/questions/46952796/android-studio-3-0-upgrade-errorcould-not-resolve-all-files-for-configuration