QQ截圖20190509115335.png
粘貼一點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 {
...
}