Android Studio: ERROR: Error:duplicate files during packaging of APK ...

From OnnoWiki
Jump to navigation Jump to search

Error

Error:duplicate files during packaging of APK /root/AndroidStudioProjects/Android-dlna/app/build/outputs/apk/app-debug-unaligned.apk
Path in archive: META-INF/beans.xml
Origin 1: /root/.gradle/caches/modules-2/files-2.1/org.fourthline.cling/cling-support/2.0.1/3be864b366ec15b075a936ecaeec731d8c62eba3/cling-support-2.0.1.jar
Origin 2: /root/.gradle/caches/modules-2/files-2.1/org.fourthline.cling/cling-core/2.0.1/c588b1493c6f92f3e63755c9b763c740546f805a/cling-core-2.0.1.jar
You can ignore those files in your build.gradle:
  android {
    packagingOptions {
      exclude 'META-INF/beans.xml'
    }
  }

Lakukan edit build.gradle, tambahkan

  android {
    packagingOptions {
      exclude 'META-INF/beans.xml'
    }
  }