Free Support Forum - aspose.com

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


I want to open a doc and docx file inside my application in Android. I am using aspose for this implementation.

I have downloaded your code and also the downloaded the Aspose.Words.lic file for license . I copied this license file in SD Card of my device , but I am getting the following exception
java.lang.NoClassDefFoundError: com.aspose.words.Document .

Kindly help me in this.

Hi Seema,


Thanks for your inquiry. We have now divided the library into following two archives. For example:

  • aspose-words-1.12-android-jdk15.jar: The first one includes public API and its auxiliary methods.
  • aspose-words-1.12-libs-android-jdk15.apk: The second one includes third party jars, basic classes and resources.

To
include Aspose.Words for Android into the project you should place
“aspose-words-1.12-android-jdk15.jar” in the folder “libs” of your
project, and the archive “aspose-words-1.12-libs-android-jdk15.apk” into
the folder “assets". After that you need to indicate in
“AndroidManifest.xml” file that you are going to use AsposeWords
application as the basic one. Please see the following markup:
<application
android:allowBackup=“true”
android:icon="@drawable/ic_launcher"
android:name=“com.aspose.words.AsposeWordsApplication”
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity

Moreover, I suggest you please increase the heap size of Android device. Hope this helps you.