【问题标题】:Mixing versions can lead to runtime crashes after adding admob ads library添加 admob 广告库后混合版本可能会导致运行时崩溃
【发布时间】:2018-05-19 19:10:28
【问题描述】:

我知道有很多这样的问题,但是没有找到任何有Admob广告依赖的问题,我只是想在我的应用程序中使用Admob广告,我添加了来自官方网站implementation 'com.google.android.gms:play-services-ads:15.0.0'的ads-dependency。

但是向我显示了这个警告:

All gms/firebase libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 15.0.1, 15.0.0. Examples include com.google.android.gms:play-services-ads-identifier:15.0.1   and com.google.android.gms:play-services-ads:15.0.0 less... (Ctrl+F1) 
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.)

我只想在没有 firebase 的情况下使用广告依赖。

【问题讨论】:

    标签: android firebase android-gradle-plugin admob build.gradle


    【解决方案1】:

    检查你的 app-gradle 文件,你的依赖有冲突。更新以下内容

    com.google.android.gms:play-services-ads:15.0.1
    

    【讨论】:

    • 我只用过_com.google.android.gms:play-services-ads:15.0.1 _
    • 还有其他依赖项与 google-services-ads 冲突。请复制并粘贴所有依赖项。
    • 'com.android.support.constraint:constraint-layout:1.1.0' 'com.google.android.gms:play-services-ads:15.0.0' 'com.android.support :appcompat-v7:27.1.1' 'com.google.android.gms:play-services-ads:15.0.0' 'com.android.support.test:runner:1.0.2' 'com.android.support. test.espresso:espresso-core:3.0.2'
    • 好的,我看到你添加了 'com.google.android.gms:play-services-ads:15.0.0' 两次,只添加一次,删除重复项。
    • 还将 gms:play-services-ads 的 15.0.0 更新为 15.0.1。或复制以下行 'com.google.android.gms:play-services-ads:15.0.1',这应该可以解决问题。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多