user1746619
user1746619

Reputation: 83

Error in creating a pdf file android

I am new to Android programming,my task was to create a pdf file in adroid

First I created a Java project using Eclipse (projectA) , wrote code in java to generate a pdf file using itext (Added jars to the project) and its working fine.

Now I created another Android project (ProjectB) , and added the itext jars (similar to projectA) and code, but it is not working properly

Error : Error generating final archive: Found duplicate file for APK: com/itextpdf/text/LICENSE.txt
Origin 1: /home/SudheerB/workspace-Ecclipse/NeedAnalyserTool13/libs/itextpdf-5.3.3-sources.jar
Origin 2: /home/SudheerB/workspace-Ecclipse/NeedAnalyserTool13/libs/itext-xtra-5.3.3-sources.jar

Can someone help me on this?

Upvotes: 1

Views: 1240

Answers (3)

shaonAshraf
shaonAshraf

Reputation: 1107

It is very simple. You are using jar files which have some common classes. so during the generation of apk file, duplicates files are being found.

just use one of the jar files. either "itextpdf.jar" or "itextpdf-xtra.jar". your problem will be solved.

Upvotes: 3

Bruno Lowagie
Bruno Lowagie

Reputation: 77528

Seems like you're using the jars that are available for Java instead of the Android/GAE port. Please switch to using the official port for Android and Google App Engine. That will solve your problem. This port isn't available from SourceForge, you need to fill out the form at http://itextpdf.com/sales/ and they'll send you a link where you can download it.

Upvotes: 0

Ridcully
Ridcully

Reputation: 23655

Remove the sources jars from your project and at least that error should go away.

Upvotes: 0

Related Questions