-
[Flutter] App requires Multidex support. 에러 해결Memo/Dart & Flutter 2024. 2. 4. 17:49
⚠️ 문제
'cloud_firestore' 패키지를 설치하고 Flutter와 Firebase를 연동하는 과정에서 아래와 같은 에러가 발생하였다.
FAILURE: Build failed with an exception.
...
[!] App requires Multidex support
...
cannot prompt without a terminal ui
Exception: Gradle task assembleDebug failed with exit code 1💡원인
Firebase와 연동하는 과정에서 많은 메서드가 사용되어 발생한 원인으로 생각된다.
안드로이드 공식 문서에서는 메서드가 64K개를 초과하면 멀티덱스 이용이 필요하다고 한다.
✅ 해결
아래와 같이 프로젝트에서 멀티덱스를 활성화하여 해결할 수 있었다.
// android/app/build.gradle ... defaultConfig { multiDexEnabled true // 추가 } ... dependencies { implementation 'com.android.support:multidex:2.0.1' // 추가 }
Multidex issue with Flutter
I'm getting the following error compiling with gradle using Flutter in Android Studio: Dex: Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/go...
stackoverflow.com
메서드가 64K개를 초과하는 앱에 관해 멀티덱스 사용 설정 | Android 개발자 | Android Developers
앱이 여러 DEX 파일을 빌드하고 읽을 수 있도록 하는 멀티덱스 앱 구성의 사용 방법에 관해 알아보세요.
developer.android.com
'Memo > Dart & Flutter' 카테고리의 다른 글
[Firebase] android, plugins {} block 에러 해결 (0) 2024.02.12 [Flutter] PlatformException(null-error, Host platform returned null value for non-null return value., null, null). 에러 해결 (0) 2024.02.05 [Flutter] Your project requires a newer version of the Kotlin Gradle plugin. 에러 해결 (0) 2024.02.04 [Flutter] SnackBar와 Toast 차이점 (0) 2024.01.15 [Flutter] AppBar 배경 색상 사라짐, 색깔 지정 방법 (0) 2024.01.10