1、异常:Resolved versions for app (26.1.0) and test app (27.1.1) differ。
解决:在build.gradle(module) dependencise中添加
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:22.1.0'
}
图示:
2、异常:Plugin with id 'com.github.dcendents.android-maven' not found.
解决:在build.gradle(project) dependcies中添加:
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
图示:
3、异常:升级到android studio 3.5.3后,gradle版本是5.4.1,run项目时报: 程序包com.huawei.hms.api不存在
解决:在gradle-wrapper.properties中修改gradle版本,降低版本,将gradle-5.4.1-all.zip改成gradle-4.6-all.zip,然后sync now同步就好了
图示:
4、异常:ERROR: Could not install Gradle distribution from 'https:/rvices.gradle.org/distributions/gradle-4.6...
解决:使用本地的gradle,先去网上下载个对应版本的gradle(https://services.gradle.org/distributions/gradle-4.6-all.zip),我这里下载的是4.6-all的,然后去setting里更改。如图: