Error: more than one library with package name 'com.google.android.gms' (v. 8.1.0)

Error: more than one library with package name 'com.google.android.gms' (v. 8.1.0)

我刚刚尝试将 play-services-analytics7.5.0 更新到 8.1.0,并且刚刚更改了 gradle 中的版本号。我得到了什么:

> Error: more than one library with package name 'com.google.android.gms'
You can temporarily disable this error with android.enforceUniquePackageName=false
However, this is temporary and will be enforced in 1.0

rebuildclean 没有帮助。我也试过删除有这个库的文件夹,没有效果。如果我将数字更改为 7.8.0(或返回 7.5.0),它也能正常工作,但不适用于 8.1.0

我的错误在哪里?

很可能您有另一个依赖于版本 7.5.0 的库。尝试 运行

gradlew :you_project_name:dependancies 

想办法解决。