본문 바로가기

나의 플랫폼/안드로이드

[Android] cannot merge new index xxxxx into a non-jumbo instruction

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

안드로이드 개발을 할 때, Library를 많이 사용할 경우 아래와 같은 에러가 발생하며 빌드가 되지 않습니다.


cannot merge new index xxxxx into a non-jumbo instruction


이건 dex index를 초과해서 발생한 에러 라고 합니다.

아래 방법 대로 해결 하시면 빌드가 잘 됩니다.


[Android studio 사용시]


참고 : http://stackoverflow.com/questions/30515209/dexindexoverflowexception-cannot-merge-new-index-65772-into-a-non-jumbo-instruc


I have tried to set jumboMode in gradle for my project, it seems able to solve the following DexIndexOverflowException:

com.android.dex.DexException: Cannot merge new index 65536 into a non-jumbo instruction!

DexIndexOverflowException: Cannot merge new index 65772 into a non-jumbo instruction!

1) What is jumboMode option actually does behind the scene?

android {
    ...
    dexOptions {
        jumboMode true
    }

}

2) I also notice that enabling multi-dex can solve the same problem as well, what is the right choice between these two approaches?

android {
    ...
    defaultConfig {
        ...
        multiDexEnabled true
    }
}


dexOptions {
        jumboMode true
    }

위에 jumboMode 만 지정해줘도 빌드가 잘 될 껍니다^^


[Eclipse 사용시]


project.properties 파일에 아래 소스를 추가 합니다.

dex.force.jumbo=true



참고 : http://stackoverflow.com/questions/13439882/android-error-in-eclipse-unable-to-execute-dex-cannot-merge-new-index-65799-i