1.异常:
Error:Could not find com.android.tools.build:gradle:2.2.2.
Searched in the following locations:
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.pom
https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.2.2/gradle-2.2.2.jar
Required by:
:SwipeBack:unspecified
原因:当前的构建工具应当使用 jcenter而不是mavenCentral
解决办法:在buildscript中把mavenCentral()改为jcenter()
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
}
}
2.异常
Error:Execution failed for task ':app:buildInfoDebugLoader'.
> Exception while doing past iteration backup : Source D:\Git_Local_Path\PureZhihuD\app\build\intermediates\builds\debug\123672835298447\classes.dex and destination D:\Git_Local_Path\PureZhihuD\app\build\intermediates\builds\debug\123672835298447\classes.dex must be different
解决办法:
Build->Rebuild Project/Clean Project