java.lang.RuntimeException: java.lang.IllegalStateException: Cannot find resource /assets/resources/ShapeTypes.txt

Hi, i get exception like this

java.lang.RuntimeException: java.lang.IllegalStateException: Cannot find resource /assets/resources/ShapeTypes.txt. when i initiate Document.class

here my code

try
{
    String path = "documentLocation";
    final Document doc = new Document(path);
}
catch (Exception e)
{
    e.printStackTrace();
}

i also get Unknown Source for com.aspose.zzYZS.zzz6

how do i fix it ?

thank you

Hi there,

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.

If the problem still remains, please attach your input Word document here for testing. I will investigate the issue on my side and provide you more information.

Hi Tahir,

thanks for answer my question,

i can’t add android:name at manifest application, because i already define with multidex method, because my method more than 65000.

is there any way to fix that beside your suggestion ?

Btw, it’s exception not happen if i try to create document in 3 times, I mean first time exception, second time still exception, but at third time, it work, it can create a pdf document. why it can happen?

hopefully you can help me.

Thank you.

Hi there,

Thanks for your inquiry. Please read the blog post about ‘How to Use Aspose.Words for Android from 1.11 Onward’ from here:
https://docs.aspose.com/words/androidjava/

Could you please attach your input Word document here for testing? I will investigate the issue on my side and provide you more information.

Hi,

I already solve the problem.

there is a simple way to solve this issued.

I directly add ShapeTypes.txt on assets/resource at my project.

Hope my solution can help other with same issued.

Thank you.

Hi there,

Thanks for your feedback. It is nice to hear from you that you have found the solution of your query. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.