简体   繁体   English

将依赖项“ com.google.android.gms:play-services-location:15.0.1”添加到“ com.android.support:appcompat-v7:28.0.0”后,遇到了错误

[英]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.

相关问题 'com.android.support:appcompat-v7:27.1.1'与com.google.android.gms冲突:play-services-maps:15.0.1? - 'com.android.support:appcompat-v7:27.1.1' conflicts with com.google.android.gms:play-services-maps:15.0.1? com.android.support:appcompat-v7与com.google.android.gms:play-services - com.android.support:appcompat-v7 vs com.google.android.gms:play-services 添加模块依赖项“ com.google.android.gms:play-services-location:16.0.0”后,Android Manifest合并失败。 - Android Manifest merger failed after adding module dependency 'com.google.android.gms:play-services-location:16.0.0'" “ com.android.support:appcompat-v7:28.0.0”错误 - “com.android.support:appcompat-v7:28.0.0” Error 实施 'com.android.support:appcompat-v7:28.0.0' - 错误 - implementation 'com.android.support:appcompat-v7:28.0.0' - Error 添加“ com.google.android.gms:play-services-location:17.0.0”库时出错 - Error while adding 'com.google.android.gms:play-services-location:17.0.0' library 实施实施'com.google.firebase:firebase-database:18.0.0'后,com.android.support:appcompat-v7:28.0.0错误 - com.android.support:appcompat-v7:28.0.0 error after implementing implementation 'com.google.firebase:firebase-database:18.0.0' 无法解决依赖 com.google.android.gms:play-services-location:16.0.0 - could not to resolve the dependency com.google.android.gms:play-services-location:16.0.0 如何解决“com.android.support:appcompat-v7:28.0.0” - How to resolve 'com.android.support:appcompat-v7:28.0.0' 实现 'com.android.support:appcompat-v7:28.0.0' - implementation 'com.android.support:appcompat-v7:28.0.0'
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM