Develop
2016.11.10 14:14
[Android Error] The number of method references in a .dex file cannot exceed 64K
Views 752 Comment 0
# 에러 내용
The number of method references in a .dex file cannot exceed 64K
Error:The number of method references in a .dex file cannot exceed 64K. Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
# 에러 원인
프로젝트에 사용되는 메소드의 개수가 64K 이상이 되었을때 발생하는 에러이다.
안드로이드 개발자 사이트에서 해결책을 제공하고 있다.
solution https://developer.android.com/studio/build/multidex.html
# 해결 방법
1. build.gradle 아래와 같이 수정하여 빌드 한다.
android { compileSdkVersion 21 buildToolsVersion "21.1.0" defaultConfig { ... minSdkVersion 14 targetSdkVersion 21 ... // Enabling multidex support. multiDexEnabled true } ... } dependencies { compile 'com.android.support:multidex:1.0.0' }
2. Application을 확장하여 사용하는 경우는,
Application을 MultiDexApplication으로 확장하여 아래와 같이 추가 하도록 한다.
public class GlobalApplication extends MultiDexApplication { @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); MultiDex.install(this); } }
TAG •
No. | Category | Subject | Author | Date | Views |
---|---|---|---|---|---|
1077 | Develop | [android] 코드에서 문자열로 Resource 가져오기 | hooni | 2015.07.09 | 3936 |
1076 | Develop | [android] 해상도 관련 팁 (dip -> pixel 변환) | hooni | 2013.04.23 | 15333 |
1075 | Develop | [android] 화면 전환(가로/세로)시 설정 | hooni | 2013.04.23 | 43371 |
1074 | PPT | [android][ios] 알림(Notification) 기능에 대한 원리와 구현 방안 (APNS포함) | hooni | 2013.04.23 | 37851 |
1073 | Develop | [android]개발 가이드 및 한글화 문서 | hooni | 2013.04.23 | 47516 |
1072 | System/OS | [apache2] Redirect HTTP to HTTPS | hooni | 2022.02.03 | 680 |
1071 | Develop | [api] 인스타그램 API Access_Token 발급 방법 (Instagram API) 3 | hooni | 2018.04.05 | 7553 |
1070 | Develop | [api] 인스타그램에서 최신 이미지 가져오기 (Using Instagram API) 20 | hooni | 2018.04.05 | 12339 |
1069 | Develop | [asem] CMOS 패스워드 알아내기.. 소스.. | hooni | 2003.04.23 | 8694 |
1068 | Develop | [asp] 기본 문법과 제어문 | hooni | 2013.04.23 | 7076 |
1067 | Develop | [asp] 문자열 관련 함수 요약 | hooni | 2013.04.23 | 7780 |
1066 | Develop | [asp] 문자열 넘겨받기 (get,post) | hooni | 2013.04.23 | 8679 |