AndroidStudio问题汇总

1.Error:Execution failed for task ':app:preDebugAndroidTestBuild'.> Conflict with dependency 'com.android.support:support-annotations' in project ':app'. 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.
解决方法
意思是测试用的库的版本和app的不一致。
在app的buildgradle配置文件中添加如下配置强制指定测试所用版本:

configurations.all { resolutionStrategy.force 'com.android.support:support-annotations:26.1.0' }
[参考文章](https://blog.csdn.net/sinat_18497785/article/details/51484140


猜你喜欢

转载自www.cnblogs.com/chao-lc/p/8999046.html