We are considering Aspose for our product and testing the free trial at the moment. We have had some success building Aspose Words into our app in Android Studio, but success with Aspose Cells is proving elusive!
In order to prevent clashes between Words and Cells, we first added the following packaging options:
This masked an OutOfMemoryException we then saw during compilation. We solved this by editing the studio.exe.vmoptions file to increase the max, and adding the following dex option:
dexOptions { javaMaxHeapSize "4g" }
This, in turn, was masking the 64K .dex file method limit, which we are now faced with!
A quick scan of the forums shows that advice in the past has been to use Eclipse/ADT rather than Android Studio (due to its early instablities and inssues), but the situation has changed since then - and Eclipse/ADT is no longer a viable option.
What can you suggest? I'm sure you understand our ability to get this working is pretty crucial, and will lead us to purchase a license if we can get things running.
I think, on Android, there is a limitation, i.e., the number of methods allowed in Android projects. Combined number of methods in two Aspose APIs exceeds this limit of 65536 so you might see ‘Unable to execute dex: method ID …: 65536’ exception. We are gradually reducing number of methods in all the Aspose APIs working on Android. In the meantime, you can try to use a tool like https://github.com/mmin18/Dex65536 to try to overcome this issue in Android APIs.
Furthermore, try to browse and get some online help regarding your issue to sort out things, e.g
Good to know that your have sorted out your issue now. Feel free to contact us any time if you need further help or have some other issue or queries, we will be happy to assist you soon.
I’m afraid this isn’t quite over! On building my APK, Android Studio has now been dexing for about 2 hours and showing no signs of progress… Do you have any further suggestions?
We will try to evaluate your issue. Please see the thread for your reference (you could try some options/approaches mentioned in the thread) if it helps to sort out your issue:
Thanks - the latest build failed with an OutOfMemoryException after about 2 hours. I’ve added a preDexLibraries false to my dexOptions in build.gradle for this module… Here’s what it looks like now:
We really appreciate your work to cope with the possible issues that might occur while using Aspose.Words and Aspose.Cells Android APIs together. I think your article would be helpful for the users who want to use different Aspose Android APIs in an Android Studio project.
Furthermore, we think we need to make our Android APIs revamped to minimize such issues. Some progress is already made to accomplish the task.
We are glad to hear that while adding above stated property, your problem is resolved and we hope that it will also benefit other customers, facing similar problem.
Please do let us know, if we can be of any related assistance.