Gradle conflict when using admob 15.0.0 with the lastest support library

只愿长相守 提交于 2020-01-01 09:17:26

问题


I am using 'com.google.android.gms:play-services-ads:12.0.1'. and android support version 27.1.1.

when I try to upgrade my ads library to the latest (15.0.0) I get an error saying that I must use the same version specification. See image below.

Is there a way to use the latest version for both the supportLibraries and the play-services-ads ?

Note that this problem does not exist when i use the play-services-ads version 12.0.1


回答1:


You can try overriding the conflicted support library by adding the support library to your dependencies block:

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



回答2:


Change all the libraries to the lowest that has conflict with in your case change some of your libraries from 27.1.1 to 26.1.0.




回答3:


I reverted back to 12.0.1

implementation 'com.google.firebase:firebase-ads:12.0.1'

Seems to me that Google need to fix this their end.

Update 4 May 2018:

Firebase-15.0.1 depends on the latest google services

classpath 'com.google.gms:google-services:3.3.0'

See this blog post

However when I upgraded google services 3.3.0 and firebase-15.0.1 I ran into other issues that I couldn't resolve. Using Google-Services 3.3.0, gradle complained about my library module that I imported:

implementation project(':lib')

Gradle Error:

More than one variant of project :lib matches the consumer attributes:

- Configuration ':lib:debugApiElements' variant android-aidl:
  - Found artifactType 'android-aidl' but wasn't required.
  - Required com.android.build.api.attributes.BuildTypeAttr 'debug' and found compatible value 'debug'.
  - Found com.android.build.api.attributes.VariantAttr 'debug' but wasn't required.
  - Required 
com.android.build.gradle.internal.dependency.AndroidTypeAttr 'Aar' and found compatible value 'Aar'.
  - Required org.gradle.usage 'java-api' and found compatible value 

So again my recommendation is not to upgrade.



来源:https://stackoverflow.com/questions/49869706/gradle-conflict-when-using-admob-15-0-0-with-the-lastest-support-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!