Android | Cannot add all Google libraries for version 15.0.1

和自甴很熟 提交于 2019-11-28 14:17:55

You cannot mix versions of firebase and google play services that are less than or equal to 12 with versions that are greater than or equal to 15.

Therefore you need to update the version number of all these libraries:

implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-analytics:15.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.android.gms:play-services-auth:15.0.1'
implementation 'com.google.android.gms:play-services-gcm:15.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-analytics:16.0.1'
implementation 'com.google.firebase:firebase-crash:16.0.1'
implementation 'com.google.firebase:firebase-messaging:17.1.0'

Check this:

https://firebase.google.com/support/release-notes/android

https://android-developers.googleblog.com/2018/05/announcing-new-sdk-versioning.html

Beginning with version 15, each Maven dependency matching com.google.android.gms:play-services-* and com.google.firebase:firebase-* is no longer required to have the same version number in order to work correctly at build time and at run time.

Also use the following google play services plugin in the top level gradle file:

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