2

I am using mixpanel for mobile analytics in my android app. Now for parsing HTML dom, I added Jsoup library and the gradle cant compile the android app.

":app:dexDebugAGPBI: {"kind":"SIMPLE","text":"UNEXPECTED TOP-LEVEL EXCEPTION:","position":{},"original":"UNEXPECTED TOP-LEVEL EXCEPTION:"}
AGPBI: {"kind":"SIMPLE","text":"com.android.dex.DexIndexOverflowException: Cannot merge new index 65775 into a non-jumbo instruction!","position":{},"original":"com.android.dex.DexIndexOverflowException: Cannot merge new index 65775 into a non-jumbo instruction!"}

I am guessing two libraries have conflicting dependencies. Any way to solve this issue?

EDIT: This stackoverflow answer solved it. com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException

Community
  • 1
  • 1
pratsJ
  • 3,369
  • 3
  • 22
  • 41
  • 1
    This error indicates that you have too many methods in your package. See: http://stackoverflow.com/questions/26093664/android-studio-only-dexexception-cannot-merge-new-index-65536-into-a-non-jumbo – Aron Lorincz Jul 31 '15 at 08:17
  • Yeah the problem you identified was correct. This one solved the problem. http://stackoverflow.com/questions/30823518/com-android-ide-common-process-processexception-org-gradle-process-internal-exe – pratsJ Jul 31 '15 at 12:39

1 Answers1

2

I had the same issue.

The proper way to fix this is by adding this to your gradle file

dexOptions{        
    jumboMode = true;
}

The proper explanation lies here: Android: Jumbo Mode vs Multidex

But in short. When a Android app compiles it takes all the constant strings declared in your project and puts them in a 16bit list. The reason you received that error is because you went over that limit. Enabling jumbo mode tells the compiler to be a 32bit list

Community
  • 1
  • 1