I downloaded all the necessary .jar files for the project (I even tried to import every .jar file in the docx4j-2.8.1 package) and added them to my project via Java Build Path --> Libraries --> Add external JARs...
After importing the JAR files, I tried to test it by typing a simple command from a tutorial:
- Code: Select all
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.createPackage();
I loaded my android application into my tablet and from the start I get errors in LogCat just for running my application:
- Code: Select all
10-24 23:30:28.412: E/AndroidRuntime(21464): FATAL EXCEPTION: main
10-24 23:30:28.412: E/AndroidRuntime(21464): java.lang.RuntimeException: Unable to instantiate application android.app.Application: java.lang.IllegalStateException: Unable to get package info for com.example.arcorauditreporter; is package not installed?
10-24 23:30:28.412: E/AndroidRuntime(21464): at android.app.LoadedApk.makeApplication(LoadedApk.java:509)
10-24 23:30:28.412: E/AndroidRuntime(21464): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4417)
10-24 23:30:28.412: E/AndroidRuntime(21464): at android.app.ActivityThread.access$1300(ActivityThread.java:141)
10-24 23:30:28.412: E/AndroidRuntime(21464): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1316)
10-24 23:30:28.412: E/AndroidRuntime(21464): at android.os.Handler.dispatchMessage(Handler.java:99)
10-24 23:30:28.412: E/AndroidRuntime(21464): at android.os.Looper.loop(Looper.java:137)
10-24 23:30:28.412: E/AndroidRuntime(21464): at android.app.ActivityThread.main(ActivityThread.java:5103)
10-24 23:30:28.412: E/AndroidRuntime(21464): at java.lang.reflect.Method.invokeNative(Native Method)
10-24 23:30:28.412: E/AndroidRuntime(21464): at java.lang.reflect.Method.invoke(Method.java:525)
10-24 23:30:28.412: E/AndroidRuntime(21464): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
10-24 23:30:28.412: E/AndroidRuntime(21464): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-24 23:30:28.412: E/AndroidRuntime(21464): at dalvik.system.NativeStart.main(Native Method)
10-24 23:30:28.412: E/AndroidRuntime(21464): Caused by: java.lang.IllegalStateException: Unable to get package info for com.example.arcorauditreporter; is package not installed?
10-24 23:30:28.412: E/AndroidRuntime(21464): at android.app.LoadedApk.initializeJavaContextClassLoader(LoadedApk.java:369)
10-24 23:30:28.412: E/AndroidRuntime(21464): at android.app.LoadedApk.getClassLoader(LoadedApk.java:322)
10-24 23:30:28.412: E/AndroidRuntime(21464): at android.app.LoadedApk.makeApplication(LoadedApk.java:501)
10-24 23:30:28.412: E/AndroidRuntime(21464): ... 11 more
Then, when I get to the page with the line of code written as above, I get more errors along with the application crashing with "Unfortunately, ____ has stopped":
- Code: Select all
10-24 23:33:10.310: E/AndroidRuntime(21541): FATAL EXCEPTION: main
10-24 23:33:10.310: E/AndroidRuntime(21541): java.lang.VerifyError: com/example/arcorauditreporter/ReportPage
10-24 23:33:10.310: E/AndroidRuntime(21541): at java.lang.Class.newInstanceImpl(Native Method)
10-24 23:33:10.310: E/AndroidRuntime(21541): at java.lang.Class.newInstance(Class.java:1130)
10-24 23:33:10.310: E/AndroidRuntime(21541): at android.app.Instrumentation.newActivity(Instrumentation.java:1061)
10-24 23:33:10.310: E/AndroidRuntime(21541): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2128)
10-24 23:33:10.310: E/AndroidRuntime(21541): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2261)
10-24 23:33:10.310: E/AndroidRuntime(21541): at android.app.ActivityThread.access$600(ActivityThread.java:141)
10-24 23:33:10.310: E/AndroidRuntime(21541): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1256)
10-24 23:33:10.310: E/AndroidRuntime(21541): at android.os.Handler.dispatchMessage(Handler.java:99)
10-24 23:33:10.310: E/AndroidRuntime(21541): at android.os.Looper.loop(Looper.java:137)
10-24 23:33:10.310: E/AndroidRuntime(21541): at android.app.ActivityThread.main(ActivityThread.java:5103)
10-24 23:33:10.310: E/AndroidRuntime(21541): at java.lang.reflect.Method.invokeNative(Native Method)
10-24 23:33:10.310: E/AndroidRuntime(21541): at java.lang.reflect.Method.invoke(Method.java:525)
10-24 23:33:10.310: E/AndroidRuntime(21541): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:737)
10-24 23:33:10.310: E/AndroidRuntime(21541): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-24 23:33:10.310: E/AndroidRuntime(21541): at dalvik.system.NativeStart.main(Native Method)
I'm not sure if I forgot a step when installing docx4j into my application aside from linking the .jar files to the project. None of the errors show up if I delete the one line of code noted in the beginning.
(I also checked stackoverflow without finding any answer to installation issues)
Any help would be appreciated!