Android Packager: java.util.zip.ZipException: duplicate entry: resources.arsc

I am creating an Android application in IntelliJ IDEA 12.1.4. I am using the latest Android SDK tools as of 8/2/2013, which rises to API level 18 for the recently released Android 4.3. My build goal is Android 4.3, and the Java SDK is 1.7.

When I try to create my application, the assembly will fail with the following message:

Error: Android Packager: [appname] java.util.zip.ZipException: duplicate entry: resources.arsc 

I acted out and searched for the exact text in the title, but could not find any links. I also tried using binging and googling java.util.zip.ZipException: re-write and find some errors related to this, but nothing that I could understand. I also researched what resource.arsc is and found out that this is a file containing precompiled resources that are in .apk.

I'm not sure that when he says “duplicate record”, it means that there is a duplicate resource in resource.arsc (because I don’t know how this file is created), or if it means that there is a second .arsc resource which he is trying to add to .apk, leading to a conflict.

Any understanding of the parts involved will probably help me find the answer, but if you have experience in resolving this issue, share it.

+4
source share
1 answer

Not surprisingly, I immediately found my answer by asking this question (for example, buy a replacement for a lost item). In File>Project Structure>Platform Settings>Global Libraries I added org.springframework.android:spring-android-rest-template:1.0.1.RELEASE from Maven. This included several .jar files. I deleted all of them, but the two that I knew were necessary were spring-android-core-1.0.1.RELEASE.jar and spring-android-rest-template-1.0.1.RELEASE.jar . As soon as I did this, the project was drafted without a hitch. Therefore, for everyone who is faced with a similar problem, check your global libraries and make sure that in any dependencies on Maven there are only those .jars that you really need.

+4
source

Source: https://habr.com/ru/post/1494961/


All Articles