android studio更新后創建新項目時出現以下錯誤

可以用Build->Rebuild Project解決,但這個方法只是臨時的,重新打開項目還是會報錯
所以用另一種方法:
在app下的build.gradle文件中的dependences {}中添加如下代碼:
androidTestCompile('com.android.support:support-annotations:26.1.0') {
force = true
}
添加后截圖:

參考自https://blog.csdn.net/fighting_2017/article/details/80244982
