【Android】Gradle Compatible Warning:All com.android.support libraries must use the exact same version specification

ちょっとfirebase使ってみたかっただけなのに、競合とかいらないから(;´・ω・)
警告だから無視してもいいのかなーと逃げたくなりつつ、競合放置は流石によくないですよね・・・
と、重い腰を上げたのでしたw
All com.android.support libraries must use the exact same version specification
(mixing versions can lead to runtime crashes).
Found versions 28.0.0, 26.1.0.
Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:support-media-compat:26.1.0
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).
Issue id: GradleCompatible
というわけで、勝手にケンカしてくれちゃってるver28さんとver26.1さんを探しに行きましょう!

Gradle 競合確認

appディレクトリ配下に移動して確認コマンドを入力します
見づらいのでファイルに出力・・・とかはご自由に
エラーログによると「com.android.support:animated-vector-drawable:28.0.0」と
「com.android.support:support-media-compat:26.1.0」がケンカしてます( `ー´)ノ
とのことでしたので、バージョンの低い26さんに折れて頂きましょう
世の中平等ではないのです( *´艸`)
競合確認で出力したファイルによると今回は、「com.android.support:support-v4:26.1.0」が原因の模様です

Gradle 競合解消

appのbuild.gradleにimplementationを追加します
各自の競合内容に合わせてライブラリ名とバージョンは変更して下さい
これで明示的に「com.android.support:support-v4」さんに28を使うようにお願いできました♪
というわけで、無事解決!d(*´▽`*)b
もう二度と競合しませんようにw

コメント

このブログの人気の投稿

Cmderのインストールと設定、消した文字が残るバグ対策etc...

Chocolateyのインストールと設定

【Android】Warning: XML tag has empty body