android - Build gradle map box and google play services -
in android application, have function works gcm , use google_play_services_lib.
now implementing mapbox maps, no google maps.
i did various tests in separate project mapbox , perfect, when compile both dependencies, applicattion not runs.
i think problem of dependencies between google play services , map box.
here script , log. hope can me. thank you.
build.gradle
apply plugin: 'com.android.application' android { compilesdkversion 21 buildtoolsversion "21.1.2" packagingoptions { exclude 'meta-inf/license.txt' exclude 'meta-inf/notice.txt' } defaultconfig { applicationid "storecheck.com.storecheck2" minsdkversion 9 targetsdkversion 20 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile ('com.mapbox.mapboxsdk:mapbox-android-sdk:0.7.1@aar'){ transitive=true } compile 'joda-time:joda-time:2.2' compile 'com.google.android.gms:play-services:+' compile 'com.android.support:appcompat-v7:20.0.0' compile "commons-io:commons-io:+" compile "org.apache.httpcomponents:httpmime:4.2.3" }
log
information:gradle tasks [:app:assembledebug] :app:prebuild up-to-date :app:predebugbuild up-to-date :app:compiledebugndk up-to-date :app:checkdebugmanifest :app:prereleasebuild up-to-date :app:preparecomandroidsupportappcompatv72000library up-to-date :app:preparecomandroidsupportsupportv42200library up-to-date :app:preparecomgoogleandroidgmsplayservices700library up-to-date :app:preparecomgoogleandroidgmsplayservicesads700library up-to-date :app:preparecomgoogleandroidgmsplayservicesanalytics700library up-to-date :app:preparecomgoogleandroidgmsplayservicesappindexing700library up-to-date :app:preparecomgoogleandroidgmsplayservicesappstate700library up-to-date :app:preparecomgoogleandroidgmsplayservicesbase700library up-to-date :app:preparecomgoogleandroidgmsplayservicescast700library up-to-date :app:preparecomgoogleandroidgmsplayservicesdrive700library up-to-date :app:preparecomgoogleandroidgmsplayservicesfitness700library up-to-date :app:preparecomgoogleandroidgmsplayservicesgames700library up-to-date :app:preparecomgoogleandroidgmsplayservicesgcm700library up-to-date :app:preparecomgoogleandroidgmsplayservicesidentity700library up-to-date :app:preparecomgoogleandroidgmsplayserviceslocation700library up-to-date :app:preparecomgoogleandroidgmsplayservicesmaps700library up-to-date :app:preparecomgoogleandroidgmsplayservicesnearby700library up-to-date :app:preparecomgoogleandroidgmsplayservicespanorama700library up-to-date :app:preparecomgoogleandroidgmsplayservicesplus700library up-to-date :app:preparecomgoogleandroidgmsplayservicessafetynet700library up-to-date :app:preparecomgoogleandroidgmsplayserviceswallet700library up-to-date :app:preparecomgoogleandroidgmsplayserviceswearable700library up-to-date :app:preparecommapboxmapboxsdkmapboxandroidsdk071library up-to-date :app:preparedebugdependencies :app:compiledebugaidl up-to-date :app:compiledebugrenderscript up-to-date :app:generatedebugbuildconfig up-to-date :app:generatedebugassets up-to-date :app:mergedebugassets up-to-date :app:generatedebugresvalues up-to-date :app:generatedebugresources up-to-date :app:mergedebugresources up-to-date :app:processdebugmanifest up-to-date :app:processdebugresources up-to-date :app:generatedebugsources up-to-date :app:compiledebugjava up-to-date :app:predexdebug up-to-date :app:dexdebug unexpected top-level exception: com.android.dex.dexindexoverflowexception: method id not in [0, 0xffff]: 65536 @ com.android.dx.merge.dexmerger$6.updateindex(dexmerger.java:502) @ com.android.dx.merge.dexmerger$idmerger.mergesorted(dexmerger.java:277) @ com.android.dx.merge.dexmerger.mergemethodids(dexmerger.java:491) @ com.android.dx.merge.dexmerger.mergedexes(dexmerger.java:168) @ 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) error:execution failed task ':app:dexdebug'. > com.android.ide.common.process.processexception: org.gradle.process.internal.execexception: process 'command '/opt/java/jdk1.7.0_65/bin/java'' finished non-zero exit value 2.
well, project in android studio. tried in eclipse, , downloaded source code of mapbox , dependencies. but, project no compile .
shows errors
"[2015-04-15 11:28:26 - dex loader] unable execute dex: multiple dex files define lcom/almeros/android/multitouch/twofingergesturedetector;"
researching, found post.
https://stackoverflow.com/a/18177694/3814000
and in comments says:
"this error can happen if have 2 jars contains same class names, e.g. had 2 library: jsr311-api-1.1.1.jar, , jersey-core-1.17.1.jar, both containing class javax.ws.rs.applicationpath. removed jsr311-api-1.1.1.jar , worked fine."
i think google play services lib , map box has problem.
but not sure
i found solution.
in mi project use gcm.
then, compile library.
compile 'com.google.android.gms:play-services-base:6.5.+'
works fine.
Comments
Post a Comment