粘贴一点gradle console的日志
* What went wrong:
Execution failed for task ':paydemo:preDebugAndroidTestBuild'.
> Conflict with dependency 'com.android.support:support-annotations' in project ':paydemo'. Resolved versions for app (26.1.0) and test app (27.1.1) differ. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1m 40s
在Android Studio 创建新项目的时候,出现这个报错:
解决办法:在app的 build.gradle 添加
android {
...
}
configurations.all {
resolutionStrategy.force 'com.android.support:support-annotations:27.1.1'
}
dependencies {
...
}
resolutionStrategy.force 'com.android.support:support-annotations:27.1.1'可以修改与v7包版本一致即可,不一定要27.1.1。