flutter 패키지에서 나는 오류를 수정하던 중에 난데없이 multidex 오류까지 나더라..
다행히 해결 방법은 간단했다.
[project]/android/app/build.gradle
파일에서 두 줄만 추가해주면 된다.
defaultConfig에 multiDexEnabled true
를 추가해주고, dependencies에 implementation 'com.android.support:multidex:2.0.1'
를 추가해준다.
android { defaultConfig { applicationId "com.jhkim.jhkimvelog" minSdkVersion 17 targetSdkVersion flutter.targetSdkVersion versionCode flutterVersionCode.toInteger() versionName flutterVersionName multiDexEnabled true // this line } ... } dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation 'com.android.support:multidex:2.0.1' // this line }
추가로 MultiDexApplication 클래스로 확장하여 사용하려면 추가 설정이 필요한데, 거기까진 아직 필요하지 않아서 일단 오류만 잡았다. (MultiDexApplication 부분은 최상단의 링크 참고)