您可以省略appcompat
依賴項,因爲design
對它有依賴性。驗證您可以使用Gradle依賴關係樹。在這裏它看起來如何。我使用com.android.support:design:24.2.1
+--- com.android.support:design:24.2.1
| +--- com.android.support:support-v4:24.2.1
| | +--- com.android.support:support-compat:24.2.1
| | | \--- com.android.support:support-annotations:24.2.1
| | +--- com.android.support:support-media-compat:24.2.1
| | | \--- com.android.support:support-compat:24.2.1 (*)
| | +--- com.android.support:support-core-utils:24.2.1
| | | \--- com.android.support:support-compat:24.2.1 (*)
| | +--- com.android.support:support-core-ui:24.2.1
| | | \--- com.android.support:support-compat:24.2.1 (*)
| | \--- com.android.support:support-fragment:24.2.1
| | +--- com.android.support:support-compat:24.2.1 (*)
| | +--- com.android.support:support-media-compat:24.2.1 (*)
| | +--- com.android.support:support-core-ui:24.2.1 (*)
| | \--- com.android.support:support-core-utils:24.2.1 (*)
| +--- com.android.support:appcompat-v7:24.2.1
| | +--- com.android.support:support-v4:24.2.1 (*)
| | +--- com.android.support:support-vector-drawable:24.2.1
| | | \--- com.android.support:support-compat:24.2.1 (*)
| | \--- com.android.support:animated-vector-drawable:24.2.1
| | \--- com.android.support:support-vector-drawable:24.2.1 (*)
| \--- com.android.support:recyclerview-v7:24.2.1
| +--- com.android.support:support-annotations:24.2.1
| +--- com.android.support:support-compat:24.2.1 (*)
| \--- com.android.support:support-core-ui:24.2.1 (*)
爲了自己使用它
搖籃(右上標籤) - >執行搖籃任務(gradle這個符號) - >確保您在:app
- >運行app:dependencies
因此com.android.support:design:25.3.1
將具有com.android.support:appcompat-v7:25.3.1
作爲依賴關係。
你會得到什麼錯誤? –