[英]After adding dependency “com.google.android.gms:play-services-location:15.0.1 ” facing error to “com.android.support:appcompat-v7:28.0.0”
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. 添加依赖项“ com.google.android.gms:play-services-location:15.0.1 ”后,它显示“ com.android.support:appcompat-v7:28.0.0 ”错误,表明所有com.android.support库必须使用完全相同的版本规范。
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. 如果我删除了gms依赖关系,则appcompact库的错误已消失。 Any solutions will be appreciated. 任何解决方案将不胜感激。
Solution: 解:
Add these lines in your gradle
as dependencies 将这些行添加到gradle
作为依赖项
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. 如果这不起作用,我将建议您使用替代解决方案。
Already answered in here : https://stackoverflow.com/a/52571055/4409113 已经在这里回答: 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. 在您的Build.gradle
依赖项中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.