Android Studio Error: Multiple dex files define Landroid/support/v4/....

出现如下图所示的错误:

Android Studio Error: Multiple dex files define Landroid/support/v4/...._第1张图片
Error.png

修改 build.gradle
compile 'com.android.support:appcompat-v7:23.0.0'

为:
compile ('com.android.support:appcompat-v7:23.0.0') {
exclude group: "com.android.support", module: "support-v4"
}

根本原因:

lib 中 有 support-v4

Android Studio Error: Multiple dex files define Landroid/support/v4/...._第2张图片
applib.png

而同时在 app中 有com.android.support-support-v4-23.0.0_70a1e73beca33f7f027c1c303b4a7b56b079756a.jar

Android Studio Error: Multiple dex files define Landroid/support/v4/...._第3张图片
app.png

修改build.grable之后,
在app中就没有com.android.support-support-v4-xx.jar

Android Studio Error: Multiple dex files define Landroid/support/v4/...._第4张图片
no-support-v4.png

参考:
http://blog.csdn.net/u013007044/article/details/51272376
http://blog.csdn.net/yanzi1225627/article/details/47361375
http://www.ifeegoo.com/eclipse-run-android-project-occurs-unable-to-execute-dex-multiple-dex-files-define-conversion-to-dalvik-format-failed-error-analysis-and-solution.html

你可能感兴趣的:(Android Studio Error: Multiple dex files define Landroid/support/v4/....)