Multiple Dex Files Define Android Studio Error When Trying To Import Google Maps Into Google Maps Project
Solution 1:
Facebook shouldn't be including the v4 support library that way -- if you include it as a regular jar instead of using its Maven coordinates, the build system isn't able to disambiguate multiple copies of it (it's picking it up through its dependency on Play Services as well).
In Facebook's build file, change its dependencies to:
dependencies {
compile files('libs/bolts.jar')
compile 'com.android.support:support-v4:19.0.+'
}
Note that the directive to auto-include all jars from the libs
directory is removed as well.
I think you're using an old version of the Facebook SDK; in v3.14.1 of the SDK, at least, this is fixed up.
EDIT:
When I first answered the question, I had a statement to use support-v4:13.0.+ of the library since that's what Facebook specifies in v3.14.1 of the SDK. However, I amended it to use support-v4:19.0.+. In your case, you're including Play Services, which depends on a later version of the support library. Perhaps getting everything on the same version of the v4 support library may help.
Also note that your dependencies show that you have a dependency on the v13 support library as well. Please be aware that there are two version numbers here; the v4 support library has a number of releases (13.0.0, 18.0.0, 19.0.0, 19.0.1, and 19.1.0), and there's a v13 support library, which has those same set of releases as well. Make sure you don't confuse the two different version numbers.
Solution 2:
Fixed it by just importing the play services into both build.cradle files compile com.google.android.gms:play-services:4.4.52
Post a Comment for "Multiple Dex Files Define Android Studio Error When Trying To Import Google Maps Into Google Maps Project"