java.lang.NoClassDefFoundError: com.aspose.words.zzZ7R

Hello

I want to convert a doc/docx file to pdf. After many research about that and test lots of library like apache poi , … I see that all of them have some problems with android so I wanted to test aspose library for my purpose and faced to this error while I select a document.
(I use aspose.word-android-via-java-17.5 as library)
Here is stack trace:

threadid=1: thread exiting with uncaught exception (group=0x4180
: java.lang.NoClassDefFoundError: com.aspose.words.zzZ7R
: at com.aspose.words.DocumentBase.(Unknown Source)
: at com.aspose.words.Document.(Unknown Source)
: at com.aspose.words.Document.(Unknown Source)
: at com.aspose.words.Document.(Unknown Source)

and this line of code have exception:
<pre style=“font-family: “Courier New”; font-size: 9pt;”>String src = “/storage/emulated/0/a.docx”;//something like this
<pre style=“font-family: “Courier New”; font-size: 9pt;”>Document doc = new Document(src);<pre style=“font-family: “Courier New”; font-size: 9pt;”>
<pre style=“font-family: “Courier New”; font-size: 9pt;”>Does anyone help me to correct this?

Hi there,

Thanks for your inquiry. It seems your application is not able to find Aspose.Words for Android via Java JAR. Please remove reference of Aspose.Words for Android via Java JAR and add it again in your project.


However, if the issue persists then please share your input Word document here, We will look into it and will guide you accordingly.

We are sorry for the inconvenience.

Best Regards,

Thanks for your help and after that


I did what you said but it didn’t work, my method for converting to pdf is:

<pre style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”> private static String readWordFile() {
String str = “”;
String src = “/storage/emulated/0/a.doc”;
String dst = “/storage/emulated/0/rasool72.pdf”;
try {
Document doc = new Document(src);
doc.save(dst);
}
catch (Exception ex) {
}
return str;
}<pre style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>
<pre style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>and I have simple word document but I send it in attachments.<pre style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>
<pre style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>

Hi there,


Thanks for your feedback. Your mentioned error is not about the Aspose.Words code but your application is unable to find Aspose.Words for Android via Java JAR. Please check following documentation link and double check whether you are adding Aspose.Words for Android via Java JAR in your project correctly. Hopefully it will help you to resolve the issue.


Best Regards,