Error in creating a pdf file android - 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?

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.

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

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.

Related

How to set the local cpp source path in Android studio for prebuild library

I created an App which includes our source code as a native lib (so-file). I'm able to step into it and everything works fine so far with this code.
This native lib links against another native lib which was pre-build on a different machine and which I copied into the jni-abi-folder. I have checked out the svn-repository of this so-file in a different folder parallel to my project and need to be able to debug also into it.
When I now do a break, I can see the method names in the callstack so I assume that the symbols can be loaded, but Android Studio doesn't know where to find the source files.
Under Visual Studio, when I did a break, I could specify the symbols in the symbol path and then an error was displaced that I should navigate to the corresponding source file. Then I only needed to navigate to the folder and it was working.
How can this be done with Android Studio - I have the newest version 3.2.1 installed.
I finally found the solution.
I got a stripped version from my colleague, he basically gave me the version inside his apk which is stripped. Now he gave me directly the build version (I think it is located somewhere in the intermediate directory or so, just search for the name of the lib).
Under Run\Edit Configurations\Debugger\LLDB startup commands the original source directory can be mapped to the source directory on my computer which is different. To achieve this, enter "settings set target.source-map or-dir cur-dir"
There should be a way to find out the original source directory from the so file, but I don't know it right now.
I hope this can help somebody else

Android studio create .jar file instead of .aar file

Hi I followed android documentation to create a library. But my problem is whenever I run the project means it is creating .aar file. I google it and found How to convert AAR to JAR
this. I'm using iZip Unarchiver. But it is not extracting the .aar file.
But they accepted that answer. Can any one know how to extract .jar from .aar. Thank you.
You can directly generate jar file using android studio. Here is a good tutorial for this.

Connection with SQLLite on Unity3D using Javascript in Android

How can connect with SQLLite from Android using Unit3D and Javascript?
Someone can'i help me?
Here are the specific steps to getting SQLite set up in your project.
Download SQLite - you'll want the ZIP file with the DLL inside
that's in the Precompiled Binaries for Windows section.
Important Copy sqlite3.dll into your into your project's Plugins folder (make a folder called Plugins if you don't have one).
You won't get a warning if you don't do this, and your project will run fine in the editor, however, it will fail to work when you actually build your project, and will only provide information about this in the log file.
This will give you a License Error if you're using Unity Indie, but it doesn't seem to have an effect on the actual play in the editor, nor does it seem to effect the ability to build stand-alone versions.
Alternately, you can leave it out of your project entirely, but when you build your application, you'll need to include a copy of sqlite3.dll in the same directory as the .exe in order for it to work.
In your project, add in the dbAccess.js file: http://wiki.unity3d.com/index.php/SQLite#dbAccess.js
You should be good to go!
Source (and the above is pretty much copied word-for-word from):
http://wiki.unity3d.com/index.php/SQLite

How can I add a jar to an APK & make the APK refer to it without Eclipse?

This may seem a bit weird, but I need to implement it.
I have an APK & I dont have its source code.
Now I can break the apk , modify & repack it, but while doing so, I need to add my custom jar to it & make the app/apk refer this library/jar at run time.
If I just create a folder libs inside the apk & put my jar inside, I get a NoClassDefFound error.
Any idea how to implement it using ANT or any other tool ?
Thanx in advance
The Jar(s) you attach in your android project, are not copied into APK.
What happens is that, The code of your Jar(s) file becomes part of your Android code. That means you can not simply place(or copy) Jar files in your APK.
But, There is a way around. In APK, your source code can be found in the classes.dex file.
What you need to do is, follow the steps
1 - Extract APK using winRAR
2 - Convert classes.dex to Jar using dex2jar
3 - Extract Jar file
4 - You will have source code in *.class, You can use JdGUI to convert it to *.java.
Now, you can create new android project and use the code.
This is not possible. All the classes are already compiled. You will need to "build" the APK again so that proper references could be remapped.

android build path conflict?

i try to embed the java file for ebay sharing with supported jar files, and i also have the jar file of ksoap2 for xml parsing.
The following error is shown in package,i don`t know how to recover it.
After implementing JRE system library the problem is resolved.

Categories

Resources