Aspose.Words can't build example with Android Studio

Hi every one.

I’m a android developer. I want to check Aspose.Words component to decide use it on our project, but I can’t build it on Android Studio. Currently Almost android developer use Android Studio to development but there aren’t any tutorial to use Aspose library with Android Studio.

I build DocumentViewer example then has error occur :

Error:(81, 21) error: cannot access zzF4

class file for asposewobfuscated.zzF4 not found

I also checked this document

https://docs.aspose.com/words/java/install-aspose-words-for-android-via-java/

Please help ( sorry about my pool english)

Any one help me

Hi Hùng,

Thanks for your inquiry. Please download this Android Studio test project. After that please do the following steps to generate .jar from .apk:

  1. Extract attached “dex2jar.zip” to "“C:\dex2jar”
  2. Go to “~\HelloWorld\app\src\main\assets” folder in “HelloWorld” project and copy “aspose-words-1.12-libs-android-jdk16.apk” to “C:\dex2jar” folder
  3. Open “aspose-words-1.12-libs-android-jdk16.apk” with WinRar and extract “classes.dex” file to “C:\dex2jar”
  4. Open command prompt in Windows and enter the following commands
  5. C:\WINDOWS\system32>cd/
  6. C:>cd dex2jar
  7. C:\dex2jar>d2j-dex2jar.bat c:\dex2jar\classes.dex
  8. dex2jar c:\dex2jar\classes.dex -> .\classes-dex2jar.jar
  9. C:\dex2jar>
  10. Now we have “classes-dex2jar.jar” which contains all the obfuscated classes
  11. Copy this .jar to “~\HelloWorld\app\libs” folder of “HelloWorld” project
  12. Now in Android Studio go to “Project Structure” of “HelloWorld” project
  13. Under “Modules”, select “app” and go to “Dependencies” tab
  14. Click ‘+’ and add a file dependency for “~\HelloWorld\app\libs\classes-dex2jar.jar”
  15. Under “Scope” column choose “Provided” value for this .jar and click OK and “Rebuild Project”.

Hope, this helps.

Best regards,

I can build “Hello Word” project, but when I add the document viewer feature => has error:

Error:Execution failed for task ‘:app:preDexDebug’.

> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘C:\Program Files\Java\jdk1.7.0_79\bin\java.exe’’ finished with non-zero exit value 1

(problem is fixed)