Question: I am getting the error: 
Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'.

> 
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/firebase/FirebaseApiNotAvailableException.class
> 
> 
> 

with code:

```
dependencies {
compile 'com.android.support:support-v4:24.0.0'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:mediarouter-v7:24.0.0'
compile(files('libs/play-hub-support.jar'))

compile('com.google.android.gms:play-services-cast:8.3.0') {
    exclude group: 'com.google.android.gms'
}
compile('com.google.android.gms:play-services-analytics:8.3.0') {
    exclude group: 'com.google.android.gms'
}
compile('com.google.android.gms:play-services-auth:9.0.2') {
    exclude group: 'com.google.android.gms'
}
compile('com.google.android.gms:play-services-ads:11.2.0') {
    exclude group: 'com.google.android.gms'
}

compile 'com.android.support:multidex:1.0.1'
compile 'com.larswerkman:HoloColorPicker:1.5'

```

}

Answer: 
Don't use different versions of Google Play Services and Firebase

```
compile('com.google.android.gms:play-services-cast:8.3.0')
compile('com.google.android.gms:play-services-analytics:8.3.0')
compile('com.google.android.gms:play-services-auth:9.0.2')
compile('com.google.android.gms:play-services-ads:11.2.0')

```

**Use the latest version** without excluding them self(\*):

```
compile('com.google.android.gms:play-services-cast:11.4.0')
compile('com.google.android.gms:play-services-analytics:11.4.0')
compile('com.google.android.gms:play-services-auth:11.4.0')
compile('com.google.android.gms:play-services-ads:11.4.0')

```

(\*)This `exclude` doesn't make sense. Remove it in your dependencies.

```
exclude group: 'com.google.android.gms'

```
Use same version for all play services