Android Build failed at ':app:dexDebug' with exception ( library and app project ) -
i using third party libraries in library project. following library project build.gradle
apply plugin: 'com.android.library' android { compilesdkversion 21 buildtoolsversion "21.1.2" defaultconfig { minsdkversion 14 targetsdkversion 21 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } //dexoptions { // javamaxheapsize "4g" //} packagingoptions { exclude 'meta-inf/dependencies' exclude 'meta-inf/license.txt' exclude 'meta-inf/notice.txt' } productflavors { } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.0' compile 'com.adobe.creativesdk:image:4.0.0' compile 'com.google.android.gms:play-services:7.5.0' } repositories { jcenter() mavencentral() maven { //url "${project.rootdir}/mobilexpresslib/creativesdk-repo" url "${project.projectdir}/creativesdk-repo" //java.lang.system.println(${project(':mobilexpresslib').projectdir}); // println "[$project.rootdir]" println "[$project.projectdir]" // url "${project(':mobilexpresslib').projectdir}/creativesdk-repo" //add correct location of creativesdk library files } }
the following app build.gradle
apply plugin: 'com.android.application' android { compilesdkversion 21 buildtoolsversion "21.1.2" defaultconfig { applicationid "com.dgflick.mxpro.mobilexpresspro" minsdkversion 14 targetsdkversion 21 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } packagingoptions { exclude 'meta-inf/license.txt' exclude 'meta-inf/notice.txt' } productflavors { } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) compile project(':mobilexpressprolib') } repositories { jcenter() mavencentral() maven { //url "${project.rootdir}/creativesdk-repo" //add correct location of creativesdk library files url "${project(":mobilexpressprolib").projectdir}/creativesdk-repo" } }
after today's update of android studio android sdk, getting following error.
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 'c:\program files\java\jdk1.7.0_71\bin\java.exe'' finished non-zero exit value 2 information:build failed
i have updated 'compile' lines in library build.gradle latest one.
after searching other links, still not find problem. possibly related version of library or multiple occurrence of library entries.
there possibility of 'creativesdk' library has older non-compatible version.
please comment on wrong.
thanks in advance .....
your app has reached limit of android app methods number. have use multidex (https://developer.android.com/tools/building/multidex.html#mdex-gradle)
Comments
Post a Comment