1

After adding dependency "com.google.android.gms:play-services-location:15.0.1 " it shows error to "com.android.support:appcompat-v7:28.0.0" It shows that all com.android.support libraries must use the exact same version specification.

My dependencies are like below:

implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation `com.android.support:appcompat-v7:28.0.0`
implementation `com.android.support:design:28.0.0`
implementation `com.android.support.constraint:constraint-layout:1.1.3`
//GMS Services for location
implementation `com.google.android.gms:play-services-location:15.0.1`

The error is:

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:media-compact-26.1.0.

If I remove gms dependency then the error for appcompact library has disappears. Any solutions will be appreciated.

ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108
Aditya Patil
  • 1,287
  • 12
  • 19

2 Answers2

0

Solution:

Add these lines in your gradle as dependencies

def support_libraries = "28.0.0"

implementation "com.android.support:appcompat-v7:$support_libraries"
implementation "com.android.support:design:$support_libraries"
implementation "com.android.support:support-compat:$support_libraries"

If this doesn't work, I'll suggest you an alternative solution.

Ümañg ßürmån
  • 9,695
  • 4
  • 24
  • 41
0

Already answered in here : https://stackoverflow.com/a/52571055/4409113

Found versions 28.0.0, 26.1.0. Examples include com.android.support:animated-vector-drawable:28.0.0 and com.android.support:media-compact-26.1.0.

Try to add:

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

In your Build.gradle dependencies.

ʍѳђઽ૯ท
  • 16,646
  • 7
  • 53
  • 108
  • Run this command on the terminal: `./gradlew app:dependencies` and add the output to your question to check what causes the issue. – ʍѳђઽ૯ท Oct 01 '18 at 06:33