Aspose.words for android跑不起来

环境:Android API 25, Java1.8
Jar:aspose-words-23.12.0-android.via.java.jar

我把Jar复制到了Android工程libs目录中,同时配置好了build文件:
implementation files(‘libs/aspose-words-23.12.0-android.via.java.jar’)

程序是这样写的:
Document doc=new Document(rootDir+“API.docx”); //1
doc.save(rootDir+“1.pdf”); //2
其中rootDir是有权限的,已经获取了目录权限,和读写权限。
执行Document的构造方法的时候就报错了如下, 请帮助看看是什么问题。
备注:Windows模拟器和小米手机都测试了,都是一样的在Document构造方法就报错了。

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.dazhousoft.asposetest, PID: 22718
java.lang.IllegalStateException: Could not execute method for android:onClick
at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:414)
at android.view.View.performClick(View.java:5637)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1119)
at android.view.View$PerformClick.run(View.java:22429)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at androidx.appcompat.app.AppCompatViewInflater$DeclaredOnClickListener.onClick(AppCompatViewInflater.java:409)
at android.view.View.performClick(View.java:5637)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1119)
at android.view.View$PerformClick.run(View.java:22429)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
Caused by: com.aspose.words.internal.zzZ0R: Exception on self test: length=32; index=32: EC
at com.aspose.words.internal.zzYZK.zzZ(Unknown Source)
at com.aspose.words.internal.zzZ1L.zzZ(Unknown Source)
at com.aspose.words.internal.zzZ1L.(Unknown Source)
at java.lang.Class.classForName(Native Method)
at java.lang.Class.forName(Class.java:400)
at java.lang.Class.forName(Class.java:326)
at com.aspose.words.internal.zzZ0P.zzwJ(Unknown Source)
at com.aspose.words.internal.zzZ0P.zzwH(Unknown Source)
at com.aspose.words.internal.zzZ0P$zzZ.run(Unknown Source)
at com.aspose.words.internal.zzZ0P.isReady(Unknown Source)
at com.aspose.words.internal.zzZ1P$zzY.(Unknown Source)
at com.aspose.words.internal.zzZ1P$zzZ.zzZ(Unknown Source)
at com.aspose.words.internal.zzS1.(Unknown Source)
at com.aspose.words.internal.zzS1.zzYv(Unknown Source)
at com.aspose.words.internal.zzXC.(Unknown Source)
at com.aspose.words.internal.zzXC.(Unknown Source)
at com.aspose.words.internal.zzXC.(Unknown Source)
at com.aspose.words.internal.zzIM.zz3(Unknown Source)
at com.aspose.words.zzYV9.zzY0(Unknown Source)
at com.aspose.words.zzZXO.zzZ(Unknown Source)
at com.aspose.words.zzZXO.zzNN(Unknown Source)
at com.aspose.words.zz7Q.zz8(Unknown Source)
at com.aspose.words.zz7Q.zzZBB(Unknown Source)
at com.aspose.words.zz7Q.zzZBM(Unknown Source)
at com.aspose.words.zz7Q.zzb(Unknown Source)
at com.aspose.words.zz3P.zzZwZ(Unknown Source)
at com.aspose.words.zz3P.zzZx0(Unknown Source)
at com.aspose.words.zz3P.zzF(Unknown Source)
at com.aspose.words.zz72.zzZAQ(Unknown Source)
at com.aspose.words.zz72.zzZAR(Unknown Source)
at com.aspose.words.zz72.zz7(Unknown Source)
at com.aspose.words.zz8D.zzXh(Unknown Source)
at com.aspose.words.zz8D.zzJ1(Unknown Source)
at com.aspose.words.zz8D.zzs(Unknown Source)
at com.aspose.words.zzZXO.zzZmK(Unknown Source)
at com.aspose.words.zzYUL.zzE(Unknown Source)
at com.aspose.words.zzYUL.zzL(Unknown Source)
at com.aspose.words.zzYUL.zzX(Unknown Source)
at com.aspose.words.zzYUL.zzO(Unknown Source)
at com.aspose.words.zzYUL.zzW(Unknown Source)
at com.aspose.words.zzZX5.zzX(Unknown Source)
at com.aspose.words.zzYUZ.zzF(Unknown Source)
at com.aspose.words.zzZWV.zzL(Unknown Source)
at com.aspose.words.zzZWC.zzF(Unknown Source)
at com.aspose.words.zzZWC.zzG(Unknown Source)
at com.aspose.words.zzYV9.zzQ(Unknown Source)
at com.aspose.words.zz1N.zzZv3(Unknown Source)
at com.aspose.words.zz1N.zzZv4(Unknown Source)
at com.aspose.words.zz1N.zzZx0(Unknown Source)
at com.aspose.words.zz1N.zzF(Unknown Source)
at com.aspose.words.zzBE.zzZ(Unknown Source)
at com.aspose.words.zzBE.zzY(Unknown Source)
at com.aspose.words.zzBE.zzw(Unknown Source)
at com.aspose.words.zz72.zzZAQ(Unknown Source)
at com.aspose.words.zz72.zzZAR(Unknown Source)
at com.aspose.words.zz72.zz7(Unknown Source)
at com.aspose.words.zz8D.zzXh(Unknown Source)
at com.aspose.words.zz8D.zzJ1(Unknown Source)
at com.aspose.words.zz8D.zzs(Unknown Source)
at com.aspose.words.zzZXO.zzZmK(Unknown Source)
at com.aspose.words.zzYUL.zzE(Unknown Source)
at com.aspose.words.zzYUL.zzL(Unknown Source)
at com.aspose.words.zzYUL.zzX(Unknown Source)
at com.aspose.words.zzYUL.zzA(Unknown Source)
at com.aspose.words.zzYUL.zzB(Unknown Source)
at com.aspose.words.zzYUL.zzX(Unknown Source)
at com.aspose.words.zzYUL.zzO(Unknown Source)
at com.aspose.words.zzYUL.zzW(Unknown Source)
at com.aspose.words.zzZX5.zzX(Unknown Source)
at com.aspose.words.zzYUZ.zzF(Unknown Source)
at com.aspose.words.zzZWV.zzL(Unknown Source)
at com.aspose.words.zzZWC.zzF(Unknown Source)
at com.aspose.words.zzZXO.zzL(Unknown Source)
at com.aspose.words.zzZXP.zzZmX(Unknown Source)
at com.aspose.words.zzZXP.zzZmY(Unknown Source)
at com.aspose.words.zzZXO.zzIw(Unknown Source)
at com.aspose.words.zzZWS.zzZlD(Unknown Source)
at com.aspose.words.zzZWS.zzIw(Unknown Source)
at com.aspose.words.zzYNP.zzIw(Unknown Source)
at com.aspose.words.Document.zzY(Unknown Source)
at com.aspose.words.Document.zzZ(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.aspose.words.Document.(Unknown Source)
at com.dazhousoft.asposetest.MainActivity.OnClick(MainActivity.java:76)
… 12 more

有没有Aspose.words for android的例子?

@amushen 我们将对问题进行调查,并向您提供相关信息。目前还没有针对 Android 的示例项目。

@amushen 错误是否发生在保存文档阶段?如果在阅读阶段,请在此处附上您用于测试的文件。

只是new Document(rootDir+“API.doc”)就已经报错了。
1.docx (40.6 KB)

API.docx (358.9 KB)

@amushen 感谢您报告此问题。 我们已经在我们的内部问题跟踪系统中打开了以下新工单,并将根据 免费支持政策 中提到的条款提供它们的修复:

Issue ID(s): WORDSJAND-553

如果您需要优先支持以及直接联系我们的付费支持管理团队,您可以获得 付费支持服务

@amushen 请使用最新的 24.3 版本检查您的问题。应该可以解决。