Search code examples
androiddex

Unable to execute dex: Multiple dex files define Lcom/google/android/gms/analytics


I got error while executing my android application. what's the actual problem of this. anyone know post it.


Solution

  • You have multiple project dependencies that use the same classes.

    In this case, com.google.android.gms.analytics is duplicated - so you should ensure you are only using this library once.

    Check your build.gradle file, your libs folder and anywhere else you define dependencies.

    I believe if you use com.google.android.gms:play-services as a dependency, newer versions contain Google Analytics by default