相信很多開發者一定會發現gradle dependencies裡通常第一行support-v7 出現紅色底線
找了很多資料大概的意思是專案的(通常是新版本),有舊版本的support庫.發生衝突,阿咧.
這種情況,很嚴重?,又好像很不嚴重-編譯跑起來又正常啊. 但是有紅色底線就是不爽.以下為我的Support-v7的狀況
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0, 27.1.1. Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:support-media-compat:27.1.1 less... (⌘F1)
Inspection info: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).
增加了support-media-compat:27.1.1 好了嗎? 並沒有. 又跳出下面
All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 28.0.0, 27.1.1. Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:support-v13:27.1.1 less... (⌘F1)
Inspection info: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).
再加.
implementation 'com.android.support:support-v13:28.0.0'
疑,好了. 再把media-compat:27.1.1移除. 也沒紅底線了.
為了釐清是不是build有暫存Build-Clean Project ,然後Rebuild Project.
再重開Android studio再Rebuild竟然修好了.
沒有留言:
張貼留言