使用Android Studio进行安卓开发常见错误集合

  1. ​ Execution failed for task ':app:preDebugAndroidTestBuild'.

Conflict with dependency 'com.android.support:support-annotations' in project ':app'. See https://d.android.com/r/tools/test-apk-dependency-conflicts.html for details.

解决方法:
在Module-level层build.gradle的Android{} 闭包中添加:

    // Resolve dependency differences between app and tests
    configurations.all {
        resolutionStrategy.force 'com.android.support:support-annotations:版本号'
    }

你可能感兴趣的:(使用Android Studio进行安卓开发常见错误集合)