ojas
ojas

Reputation: 2210

Android: Dex Issue(UNEXPECTED TOP-LEVEL EXCEPTION:)

My app is showing error while compiling when i use these 3 jar files:

Activation.jar mail.jar additionnal.jar

I Need these jar files to send email without user intervention.

I am getting following error:
UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536
Error:Execution failed for task ':app:dexDebug'. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 2

I cant use multidex enabled as true and extends MultiDexActivity in my main file as i am using AppCombat Activity in my app.

My Gradle file looks like this:

dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'com.parse.bolts:bolts-android:1.+'
    compile fileTree(dir: 'libs', include: 'Parse-*.jar')
    compile fileTree(dir: 'libs', include: 'ParseCrashReporting-*.jar')
    compile fileTree(dir: 'libs', include: 'additionnal.jar')
    compile fileTree(dir: 'libs', include: 'mail.jar')
    compile fileTree(dir: 'libs', include: 'activation.jar')
    compile 'com.github.traex.rippleeffect:library:1.3'
    compile 'com.facebook.android:facebook-android-sdk:4.1.0'
    compile 'com.google.android.gms:play-services:7.5.0'
    compile 'com.jpardogo.materialtabstrip:library:1.1.0'
    compile 'com.android.support:recyclerview-v7:21.+'
    compile 'com.android.support:cardview-v7:21.+'
    compile 'com.pkmmte.view:circularimageview:1.1'
    compile "com.android.support:support-v4:+"
    compile 'com.squareup.picasso:picasso:2.3.2'
    compile 'com.nineoldandroids:library:2.4.0'
    compile 'com.daimajia.slider:library:1.1.5@aar'
    compile 'com.getbase:floatingactionbutton:1.10.0'
    compile 'com.github.navasmdc:MaterialDesign:1.5@aar'
    compile 'com.github.PhilJay:MPAndroidChart:v2.1.3'

}

Upvotes: 0

Views: 233

Answers (1)

solar
solar

Reputation: 1364

If you cannot use MultiDex for some reasons, why not trying Proguard to optimize your code? As I know, it can also perform optimizations at the bytecode level, inside and across methods, inline private methods to reduce amount of them, so you'll be able to avoid this 65k limit. For more details on configuration you may wanna look here.

Upvotes: 1

Related Questions