1. Build APK 실행시 오류 발생

Error:Execution failed for task ':app:transformClassesWithDexForDebug'.

> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/support/v13/view/DragAndDropPermissionsCompat;



2. 폭풍 검색

3. Android Studio에서 Terminal 창을 연다(보통 하단에 있음!)

4. 명령어 실행

gradlew app:dependencies


5. 뭔가 버전 충돌이 나는 곳을 찾는다!

+--- com.android.support:appcompat-v7:27.1.1
|    +--- com.android.support:support-annotations:27.1.1
|    +--- com.android.support:support-core-utils:27.1.1
|    |    +--- com.android.support:support-annotations:27.1.1
|    |    \--- com.android.support:support-compat:27.1.1
|    |         +--- com.android.support:support-annotations:27.1.1
|    |         \--- android.arch.lifecycle:runtime:1.1.0
|    |              +--- android.arch.lifecycle:common:1.1.0
|    |              \--- android.arch.core:common:1.1.0
|    +--- com.android.support:support-fragment:27.1.1
|    |    +--- com.android.support:support-compat:27.1.1 (*)
|    |    +--- com.android.support:support-core-ui:27.1.1
|    |    |    +--- com.android.support:support-annotations:27.1.1
|    |    |    +--- com.android.support:support-compat:27.1.1 (*)
|    |    |    \--- com.android.support:support-core-utils:27.1.1 (*)
|    |    +--- com.android.support:support-core-utils:27.1.1 (*)
|    |    +--- com.android.support:support-annotations:27.1.1
|    |    +--- android.arch.lifecycle:livedata-core:1.1.0
|    |    |    +--- android.arch.lifecycle:common:1.1.0
|    |    |    +--- android.arch.core:common:1.1.0
|    |    |    \--- android.arch.core:runtime:1.1.0
|    |    |         \--- android.arch.core:common:1.1.0
|    |    \--- android.arch.lifecycle:viewmodel:1.1.0
|    +--- com.android.support:support-vector-drawable:27.1.1
|    |    +--- com.android.support:support-annotations:27.1.1
|    |    \--- com.android.support:support-compat:27.1.1 (*)
|    \--- com.android.support:animated-vector-drawable:27.1.1
|         +--- com.android.support:support-vector-drawable:27.1.1 (*)
|         \--- com.android.support:support-core-ui:27.1.1 (*)
+--- com.android.support:design:27.1.1
|    +--- com.android.support:support-v4:27.1.1
|    |    +--- com.android.support:support-compat:27.1.1 (*)
|    |    +--- com.android.support:support-media-compat:27.1.1
|    |    |    +--- com.android.support:support-annotations:27.1.1
|    |    |    \--- com.android.support:support-compat:27.1.1 (*)
|    |    +--- com.android.support:support-core-utils:27.1.1 (*)
|    |    +--- com.android.support:support-core-ui:27.1.1 (*)
|    |    \--- com.android.support:support-fragment:27.1.1 (*)
|    +--- com.android.support:appcompat-v7:27.1.1 (*)
|    +--- com.android.support:recyclerview-v7:27.1.1
|    |    +--- com.android.support:support-annotations:27.1.1
|    |    +--- com.android.support:support-compat:27.1.1 (*)
|    |    \--- com.android.support:support-core-ui:27.1.1 (*)
|    \--- com.android.support:transition:27.1.1
|         +--- com.android.support:support-annotations:27.1.1
|         \--- com.android.support:support-compat:27.1.1 (*)
+--- com.android.support:support-emoji:27.1.1
|    \--- com.android.support:support-compat:27.1.1 (*)
+--- com.github.rey5137:material:1.2.4
|    +--- com.android.support:cardview-v7:23.4.0
|    +--- com.android.support:appcompat-v7:23.4.0 -> 27.1.1 (*)
|    \--- com.android.support:recyclerview-v7:23.4.0 -> 27.1.1 (*)
+--- com.afollestad.material-dialogs:core:0.9.4.3
|    +--- com.android.support:support-v13:25.3.1
|    |    +--- com.android.support:support-annotations:25.3.1 -> 27.1.1
|    |    \--- com.android.support:support-v4:25.3.1 -> 27.1.1 (*)
|    +--- com.android.support:appcompat-v7:25.3.1 -> 27.1.1 (*)
|    +--- com.android.support:recyclerview-v7:25.3.1 -> 27.1.1 (*)
|    +--- com.android.support:support-annotations:25.3.1 -> 27.1.1
|    \--- me.zhanghai.android.materialprogressbar:library:1.4.0
|         +--- com.android.support:appcompat-v7:25.3.1 -> 27.1.1 (*)
|         \--- com.android.support:support-annotations:25.3.1 -> 27.1.1
...후략


6.  이곳이 문제가 아닐까 짐작을 해본다.


7. 이렇게 해당 모듈을 제외하고 컴파일 할 수 있도록 build.gradle 파일을 수정한다.

dependencies {
    ....
    compile ('com.afollestad.material-dialogs:core:0.9.4.3') {
        exclude module: 'support-v13'
    }
}


8. Build APK 해보니, 된다!

+ Recent posts