3

I have read the article All com.android.support libraries must use the exact same version specification

But I still get the following information after I add the code implementation 'com.google.android.gms:play-services-ads:17.0.0', why?

Information

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:customtabs:26.1.0 more... (Ctrl+F1)

The information keep even if I Clean project and Rebuild Project.

Code

You can download the code at https://www.dropbox.com/s/zlg731ovf7h3bmi/NewMyApplication.zip?dl=0

Image1

enter image description here

Image2 enter image description here

HelloCW
  • 843
  • 22
  • 125
  • 310
  • 3
    Related https://stackoverflow.com/questions/42374151/all-com-android-support-libraries-must-use-the-exact-same-version-specification – AskNilesh Nov 02 '18 at 09:35

3 Answers3

9

Some or one of your libraries use an old version of customtabs internally, that's why this warning message is showing. If you implement this with the latest version then the warning will be gone.

implementation 'com.android.support:customtabs:28.0.0'

After adding this I have also shown the same error for another older version of dependencies. After adding this also all warning is gone.

implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'

Hope this will help you to solve your problem.

Also you can check this: https://stackoverflow.com/a/42374426/5167909

Faysal Ahmed
  • 7,501
  • 5
  • 28
  • 50
0

I think that play-services-ads:17.0.0 include appcompat 26.1.0. Try to exclude it:

implementation ("com.google.android.gms:play-services-ads:17.0.0") {
    exclude group: "com.android.support"
}
punchman
  • 1,350
  • 1
  • 13
  • 23
  • Do you mean that I needn't add `com.google.android.gms:play-services-ads:17.0.0` when appcompat is 26.1.0 or above? – HelloCW Nov 02 '18 at 09:51
  • You can use it, but it seems that `com.google.android.gms:play-services-ads:17.0.0` uses old version of appcompat. `exclude group: "com.android.support"` need to help you – punchman Nov 02 '18 at 09:58
0

For now, just include noninspection to suppresses the warning

//noinspection GradleCompatible
implementation 'com.google.android.gms:play-services-ads:17.0.0'

//noinspection GradleCompatible
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:appcompat-v7:28.0.0'

implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'

Everything will work fine.

olajide
  • 972
  • 1
  • 13
  • 26