I have the following error while building my APK.
Duplicate files copied in APK META-INF/android.arch.lifecycle_runtime.version
File1: /Users/.../build/intermediates/exploded-aar/com.google.android.gms/play-services-base/12.0.0/jars/classes.jar
File2: /Users/.../build/intermediates/exploded-aar/android.arch.lifecycle/runtime/1.1.1/jars/classes.jar
The dependencies added in app build.gradle are as follows
compile "android.arch.lifecycle:runtime:1.1.1"
compile "android.arch.lifecycle:extensions:1.1.1"
compile "com.google.android.gms:play-services-base:12.0.0"
compile "com.google.android.gms:play-services-identity:12.0.0"
compile "com.google.android.gms:play-services-auth:12.0.0"
compile "com.google.android.gms:play-services-auth-api-phone:12.0.0"
It says that it found two files with the same library, one in your first compile :
And then another one in
That's because
com.google.android.gms:play-services-base:12.0.0already containslifecycle:runtimejust remove the first line and then rebuild/clean the project again.If it did not work just exclude this in your
gradle.buildas pointed in this issuePlus you can take a look on this problem too : Similar problem