1. 程式人生 > >刪除External Libraries下的jar包(Conflict with dependency)

刪除External Libraries下的jar包(Conflict with dependency)

使用AS 3.0 時候新建專案,講一些依賴庫版本改成低版本時候出現如下問題,提示包衝突

Error:Execution failed for task ':app:preDebugAndroidTestBuild'.
> Conflict with dependency 'com.android.support:support-annotations' in project ':app'. Resolved versions for app (24.1.1) and test app (27.1.1) differ. See https://d.android.com/r/tools/test
-apk-dependency-conflicts.html for details.

在AS中全域性搜尋27.1.1也沒有找到,Clean project和Invalidate Caches/Restart都沒有作用,後來發現External Libraries下有這個jar包,如下圖,有兩個support-annotations 包,一個24.1.1,一個27.1.1導致衝突
兩個support-annotations包
那麼就想辦法刪除這個包,發現右鍵External Libraries下這個jar發現沒有delete選單,如下圖
右鍵沒有delete選單
點選該條目左邊的小三角,如下圖
點選該條目左邊小三角
然後再右鍵點選這個jar包,發現有delete選單
發現delete選單


點選刪除,重新build就可以了