I am evaluating Aspose.Words for Android SDK. I am using SDK for converting .docx to .pdf file. At first I used version 24.6 and it worked. But when I implemented latest version (25.3) I got this exception:
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/bouncycastle/operator/DefaultAlgorithmNameFinder;
at com.aspose.words.internal.zzRN.<clinit>
(Unknown Source:851)
at com.aspose.words.internal.zzI2.zzW(Unknown Source:22)
at com.aspose.words.zzXXC.zzZ(Unknown Source:10030)
at com.aspose.words.zzXXC.zzZH(Unknown Source:551)
at com.aspose.words.zzXXC.zzZI(Unknown Source:493)
at com.aspose.words.Document.zzZ(Unknown Source:1127)
at com.aspose.words.Document.save(Unknown Source:1102)
at com.aspose.words.Document.save(Unknown Source:1075)
at com.example.wordwithaspose.MainActivity$convertWordToPdf$1$1.invokeSuspend(MainActivity.kt:47)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115)
at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103)
at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697)
at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@37d50f6, Dispatchers.Main]
Caused by: java.lang.ClassNotFoundException: Didn't find class "org.bouncycastle.operator.DefaultAlgorithmNameFinder" on path: DexPathList[[zip file "/data/app/~~f5SHECweTgtXeguHG_lJ8Q==/com.example.wordwithaspose-i5sLp-R5OHwFCJw8vFEAbw==/base.apk"],nativeLibraryDirectories=[/data/app/~~f5SHECweTgtXeguHG_lJ8Q==/com.example.wordwithaspose-i5sLp-R5OHwFCJw8vFEAbw==/lib/x86_64, /system/lib64, /system_ext/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:259)
at java.lang.ClassLoader.loadClass(ClassLoader.java:379)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
After I got this exception I included bouncy castle library in build.gradle like this:
implementation("org.bouncycastle:bcpkix-jdk18on:1.81")
But even then I still get the same exception.
What could be the possible solution for this exception?