Error: more than one library with package name 

2019-09-02 10:31发布

问题:

I just tried to update play-services-analytics from 7.5.0 to 8.1.0 and just changed the version number in gradle. And what I got:

> 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

rebuild and clean don't help. I also tried to delete the folder with this library, no effect. If I change the number to 7.8.0 (or back to 7.5.0) it also works well, but not with 8.1.0

Where is my mistake?

回答1:

Most likelay you have another library that depends on version 7.5.0. Try to run

gradlew :you_project_name:dependancies 

To figure it out.