Cannot import two libraries in one project

Hi Aspose,
I cannot import two libraries in one project.

I have created an Android project on Eclipse, and imported the the example project:
…\Aspose_Words_Android-master\QuickStart\DocumentViewer
Then I have imported the word library aspose-words-1.12-android-jdk16.jar

I was able to proceed.
But when I tried to import a pdf library “Aspose.Pdf.Android-1.4.jar” or the cell lib “aspose.slides-1.1.0.jar”, I was unable to run the project because of error in the dex files.

[2014-11-06 17:15:13 - Dex Loader] Unable to execute dex: method ID not in [0, 0xffff]: 65536
[2014-11-06 17:15:13 - DocumentViewer] Conversion to Dalvik format failed: Unable to execute dex: method ID not in [0, 0xffff]: 65536

The project attached

Hi,


Could you add a line to the end in the project.properties file if it makes any difference:

“dex.force.jumbo=true”

The file “project.properties” is there in your ADT project directory in Package Explorer.

Thanks,

Hi Mohamed,

We are working on this issue and will update you soon. Sorry for the inconvenience.

Best Regards,

Hi Mohamed,

The problem is because of the limitation on number of methods allowed in Android projects. Combined number of methods in two Aspose APIs exceeds this limit of 65536 so you see this issue. We will gradually reduce number of methods in Aspose APIs.

In the meantime, you can use a tool like https://github.com/mmin18/Dex65536 to overcome this issue.

Best Regards,

Hi Muhammad,

I am able to run the example attached in the Dextool, but unable to use with the DocumentViewer project attached here before.

Here is the error:

-compile:
[javac] Compiling 8 source files to …\Aspose\Aspose_Words_Android-master\QuickStart\DocumentViewer\bin\classes
[javac] …\Aspose\Aspose_Words_Android-master\QuickStart\DocumentViewer\src\com\aspose\words\android\AsposeWordsViewerActivity.java:85: cannot access asposewobfuscated.zzF4
[javac] class file for asposewobfuscated.zzF4 not found
[javac] Document doc = new Document(uriFile.getPath());
[javac] ^
[javac] 1 error

BUILD FAILED


muhammad.ijaz:

Hi Mohamed,

The problem is because of the limitation on number of methods allowed in Android projects. Combined number of methods in two Aspose APIs exceeds this limit of 65536 so you see this issue. We will gradually reduce number of methods in Aspose APIs.

In the meantime, you can use a tool like https://github.com/mmin18/Dex65536 to overcome this issue.

Best Regards,

Hi Mohamed,

You can download latest version of this sample from https://github.com/asposewords/Aspose_Words_Android

Please also check Aspose for Maven - Aspose Maven Repository for Java File Format APIs for more details.

Best Regards,