Unable to execute dex: Multiple dex files define Lbolts/AggregateException

RESOLVED

bolts-android library was the real trouble here. There were two different versions of it causing a conflict. The FacebookSDK library brings bolts-android-1.1.2, and android-support-v7-appcompat brings bolts-android-1.1.4.

I unmarked Android Private Libraries container in the FacebookSDKlibrary project, which contained bolts-android-1.1.2. As a result, my project now had only one version, bolts-android-1.1.4, settling the conflict. It runs fine now.

Also, turns out, the duplicate android-support-v7-appcompat entries were not an issue.


i encountered this recently on my react native project, you can go to your android folder of your project . and in terminal hit this command "./gradlew app:dependencies" to see dependencies tree. i found two package for android bolts under facebook sdk . if you exclude this package from facebook sdk things will work fine again

compile ('com.facebook.react:react-native:+') {
   exclude group: 'com.parse.bolts', module: 'bolts-tasks'
}

This can happen when adding facebook SDK to Android, you can solve it with:

compile ("com.facebook.android:facebook-android-sdk:4.1.0") {
    exclude group: 'com.parse.bolts', module: 'bolts-android'
}