본문 바로가기
Programming/Flutter(앱)

플러터(flutter) - single dex file (mergeExtDexDebug) 오류

by JeeU147 2023. 10. 2.
반응형

안녕하세요.

 

오늘은 플러터(flutter) - single dex file (mergeExtDexDebug) 오류에 대해서 알아보려고 합니다.

 

에러 메시지

ERROR:D8: Cannot fit requested classes in a single dex file (# methods: 79108 > 65536)
com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
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

 

Execution failed for task ':app:mergeExtDexDebug'.

 

앱과 라이브러리가 65,536개 메서드를 초과하는 경우 앱이 Android 빌드 아키텍처의 한도에 도달했음을 나타내는 다음 빌드 오류가 발생합니다.

오류 해결 방법

multidex는 메서드가 64k(65536)개를 초과하지 않도록 dex파일을 여러 개로 나누고 나눠진 dex file을 읽을 수 있게 해준다.

 

파일 위치 : android\app\build.gradle

 

해당 파일에 있는 defaultConfig 부분을 아래와 같이 multiDexEnabled true 를 추가해주시면 해결이 됩니다.

 

defaultConfig {
        // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
        applicationId "com.example.test"
        // You can update the following values to match your application needs.
        // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
        minSdkVersion flutter.minSdkVersion
        targetSdkVersion flutter.targetSdkVersion
        versionCode flutterVersionCode.toInteger()
        versionName flutterVersionName
        multiDexEnabled true
    }

 

 

이것으로 플러터(flutter) - single dex file (mergeExtDexDebug) 오류에 대해서 알아보았습니다.

 

감사합니다.

 

참조 사이트 : https://developer.android.com/build/multidex

 

Enable multidex for apps with over 64K methods  |  Android Studio  |  Android Developers

Learn how to enable an app configuration known as multidex, which allows your app to build and read multiple DEX files.

developer.android.com

반응형

댓글