본문 바로가기

[Unity/Android] The number of method references in a .dex file cannot exceed 64K 본문

프로그래밍/ㄴ이슈

[Unity/Android] The number of method references in a .dex file cannot exceed 64K

최갓 2020. 12. 29. 15:25
반응형

애드몹 미디에이션 패키지를 추가하고 빌드하니 다음과 같은 에러가 발생했다.

 

The number of method references in a .dex file cannot exceed 64K

분명 이미 멀티덱스 세팅을 했을텐데도 위와 같은 에러가 발생해 당황스러웠지만,

아래 방법으로 해결했다.

 

Unity BuildSetting에서 Custom Launcher Gradle Template를 체크해준다.

그럼 LauncherTemplate.gradle파일이 생성된다.

 

 defaultConfig {
        minSdkVersion **MINSDKVERSION**
        targetSdkVersion **TARGETSDKVERSION**
        applicationId '**APPLICATIONID**'
        ndk {
            abiFilters **ABIFILTERS**
        }
        versionCode **VERSIONCODE**
        versionName '**VERSIONNAME**'
        multiDexEnabled true //해당 옵션 추가
    }

 

gradle파일에 multiDexEnable true옵션을 넣어주자.

반응형
Comments