Duplicate files at the same path inside the APK

I have an application using some librarries.

The problem is that when I am trying o export the apk file, I am getting the “Duplicate files at the same path inside the APK”.

  • How to use Percentage for android layout?
  • How do task killers work?
  • Android Studio not deploying changes to app
  • Android :java.lang.SecurityException: Injecting to another application requires INJECT_EVENTS permission
  • Android: EditText hint in single line
  • Android setError(“error”) not working in Textview
  • Here is the log:

    org.eclipse.core.runtime.CoreException: Duplicate files at the same path inside the APK
    at com.android.ide.eclipse.adt.internal.project.ExportHelper.exportReleaseApk(ExportHelper.java:284)
    at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.doExport(ExportWizard.java:295)
    at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard.access$0(ExportWizard.java:232)
    at com.android.ide.eclipse.adt.internal.wizards.export.ExportWizard$1.run(ExportWizard.java:217)
    at org.eclipse.jface.operation.ModalContext$ModalContextThread.run(ModalContext.java:121)
    Caused by: com.android.sdklib.build.DuplicateFileException: Duplicate files at the same path inside the APK
    at com.android.sdklib.build.ApkBuilder$JavaAndNativeResourceFilter.checkEntry(ApkBuilder.java:123)
    at com.android.sdklib.internal.build.SignedJarBuilder.writeZip(SignedJarBuilder.java:225)
    at com.android.sdklib.build.ApkBuilder.addResourcesFromJar(ApkBuilder.java:563)
    at com.android.ide.eclipse.adt.internal.build.BuildHelper.finalPackage(BuildHelper.java:372)
    at com.android.ide.eclipse.adt.internal.project.ExportHelper.exportReleaseApk(ExportHelper.java:255)
    ... 4 more
    

    Anyone has to manage this problem?

    Thank you very much.

    EDIT: Solution

    I figured out what the problem was. I included a JAR file that had an AndroidManifest.xml file in it, which was conflicting with my own project’s AndroidManifest.xml file. The solution in my instance was to rebuild the JAR file, making sure it excluded its own version of AndroidManifest.xml, then to re-include the new version of the JAR file into my project. You might need to clean the project after doing this.

  • Android SeekBar setOnSeekBarChangeListener
  • Android 5.0 material design style navigation drawer for KitKat
  • How to create Google + cards UI in a list view?
  • NavigationView and custom Layout
  • Testing SQLite database in Robolectric
  • Any advantage of programming natively for mobile development?
  • 3 Solutions collect form web for “Duplicate files at the same path inside the APK”

    Check the external jars you have imported in your application..

    Project Properties -> Java Build Path -> Libraries -> Add External JARs...
    

    There might be some duplicate files imported!

    If you happen to be having this issue while using Maven to do your build, I was able to fix it by putting in:

    <extractDuplicates>true</extractDuplicates>
    

    into the Maven Android plugin configuration tag.

    I figured out what the problem was. I included a JAR file that had an AndroidManifest.xml file in it, which was conflicting with my own project’s AndroidManifest.xml file. The solution in my instance was to rebuild the JAR file, making sure it excluded its own version of AndroidManifest.xml, then to re-include the new version of the JAR file into my project. You might need to clean the project after doing this.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.