The supplied build action failed with an exception

现在远程办公,导入公司三年前项目报错
错误1:The supplied build action failed with an exception.
用gradlew --stacktrace发现报错2:org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.android.support:multidex:1.0.1.
解决方法为在 allprojects 字段中增加 google() 源服务器。
然后又报错Could not find method google() for arguments [] on repository container
解决:
1.修改gradle/wrapper/gradle-wrapper.properities里的distributionUrl版本
2.打开项目根目录下的android/build.gradle

1)、在buildscript和allprojects下的repositories分别添加google()

2)、将dependencies中的classpath 'com.android.tools.build:gradle:2.2.3’中的版本号改成对应的

比如我这边:distributionUrl=https://services.gradle.org/distributions/gradle-4.1-all.zip对应的classpath是classpath ‘com.android.tools.build:gradle:3.0.1’

你可能感兴趣的:(Android)