新建專案時預設引入的v7依賴包衝突implementation 'com.android.support:appcompat-v7:27.1.1'
阿新 • • 發佈:2018-11-11
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 27.1.1, 25.3.0. Examples include com.android.support:animated-vector-drawable:27.1.1 and com.android.support:design:25.3.0 less... (Ctrl+F1) There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion.)
若按提示加入
//noinspection GradleCompatible
編譯不會出現問題但在除錯的時候就會報錯
看提示應該是com.android.support:design版本和com.android.support:appcompat中顯示的版本衝突,這時候把design版本置換即可,在dependencies中加入:
implementation 'com.android.support:design:27.1.1'