Top-Level Exception app:dexDebug --dex -no-optimize --output android studio

前端 未结 1 1377
我在风中等你
我在风中等你 2021-01-16 09:30

I am migrating my Android code from Eclipse to Android studio and have been stuck at the following error. The project builds fine and syncs with gradle, but it throws the fo

1条回答
  •  北海茫月
    2021-01-16 09:44

    In Android build fails over com.android.dex.DexException: Multiple dex files define Landroid/support

    Solved with exclude as

    dependencies {
        compile fileTree(dir: 'libs', include: '*.jar', exclude: 'android-support-*.jar')
        //...
    }
    

    and

    At Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat it easy as exclude module: 'support-v4'

    example

    dependencies {
        compile('com.commonsware.cwac:camera-v9:0.5.4') {
          exclude module: 'support-v4'
        }
    
        compile 'com.android.support:support-v4:18.0.+'
    }
    

    (also posted to Gradle Exclude or add reference for JAR file hard included inside library classes.jar)

    0 讨论(0)
提交回复
热议问题