issue in getting dex file while adding google play service and osm jar android -


i m implement osm app google play store add below jars.

when run project getting below error

error code:2  output: unexpected top-level exception: com.android.dex.dexexception: multiple dex files define lcom/google/api/client/googleapis/notifications/json/gson/gsonnotificationcallback; @ com.android.dx.merge.dexmerger.readsortabletypes(dexmerger.java:596) @ com.android.dx.merge.dexmerger.getsortedtypes(dexmerger.java:554) @ com.android.dx.merge.dexmerger.mergeclassdefs(dexmerger.java:535) @ com.android.dx.merge.dexmerger.mergedexes(dexmerger.java:171) @ com.android.dx.merge.dexmerger.merge(dexmerger.java:189) @ com.android.dx.command.dexer.main.mergelibrarydexbuffers(main.java:454) @ com.android.dx.command.dexer.main.runmonodex(main.java:303) @ com.android.dx.command.dexer.main.run(main.java:246) @ com.android.dx.command.dexer.main.main(main.java:215) @ com.android.dx.command.main.main(main.java:106) 

build.gradle

apply plugin: 'com.android.application'   android { compilesdkversion 22 buildtoolsversion "22.0.1"  defaultconfig {     applicationid "com.pkg.name"     minsdkversion 14     targetsdkversion 22     versioncode 1     versionname "1.0" } buildtypes {     release {         minifyenabled false         proguardfiles getdefaultproguardfile('proguard-android.txt'),   'proguard-rules.pro'     }   }  }   dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.0' compile project(':mapsforgeforosmdroid') compile project(':osmbonuspack') compile 'com.android.support:gridlayout-v7:22.2.0' compile files('libs/picasso-2.5.2.jar') compile 'com.google.api-client:google-api-client:1.20.0'  compile 'com.google.api-client:google-api-client-android:1.20.0'  compile 'com.google.api-client:google-api-client-gson:1.20.0'  compile 'com.google.apis:google-api-services-calendar:v3-rev125-1.20.0' compile 'com.google.android.gms:play-services:7.5.0' /*    compile 'com.google.android.gms:play-services:7.5.0' compile files('libs/google-api-client-appengine-1.20.0.jar') compile files('libs/google-api-client-1.20.0 (2).jar') compile files('libs/google-api-client-gson-1.19.0.jar') compile files('libs/google-api-services-calendar-v3-rev133-1.20.0.jar') compile files('libs/google-api-client-android-1.20.0 (1).jar')*/    //compile files('libs/google-api-client-util-1.2.1-alpha.jar') } 

i think osmbonuspack brings in copy of gson. try adding exclusion it.

edit: can find offending library using

gradle dependencies

once it's located, can exclude using (a few examples)

   compile('group:artifact:version') {        exclude module: 'cglib' //by artifact name       exclude group: 'org.jmock' //by group      exclude group: 'org.unwanted', module: 'iambuggy' //by both name , group } 

Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -