chennaione / sugar

Insanely easy way to work with Android Database.
http://satyan.github.com/sugar/
MIT License
2.62k stars 583 forks source link

Gradle raises "Multiple dex files define Lcom/google/common/annotations/Beta when I use sugar orm with google play services #622

Open rinikaravinth opened 8 years ago

rinikaravinth commented 8 years ago

My app level build.gradle is like this:

`compile 'com.github.satyan:sugar:1.4'
compile('com.google.api-client:google-api-client-android:1.22.0') {
    exclude group: 'org.apache.httpcomponents'
}
compile('com.google.apis:google-api-services-drive:v3-rev29-1.22.0') {
    exclude group: 'org.apache.httpcomponents'
}`

But when I build the project it raises 'Multiple dex files define Lcom/google/common/anotations/Beta And when I remove compile 'com.github.satyan:sugar:1.4' it builds without errror. What could be the reason?

cpritchard commented 8 years ago

In android studio if you change the Android dropdown in the project panel to "Project" you can see all of the external libraries and reliance that are imported. You should be able to find the culprit package and exclude as neccessary.

larrytech7 commented 8 years ago

You have a conflict with the packages you are importing. You can always scan your packages for overrides. Also try to drop your trace here for further analysis.

eulerjacson commented 8 years ago

if more people with this problem, it resolved for me:

compile ('com.github.satyan:sugar:1.4'){
        exclude module: 'guava'
 }