Hey,
I’m creating an android application which should convert pptx files to pdf.
It needs to be a system app so I’ve added android:sharedUserId="android.uid.system"
into the manifest.
I don’t get errors when this is removed but I need it to be a system app.
When I run it as system app I get these errors:
FATAL EXCEPTION: main (Ask Gemini)
Process: com.prowise.app.pptx_import_android, PID: 5930
java.lang.ExceptionInInitializerError
at com.aspose.slides.PPImage.(Unknown Source:23)
at com.aspose.slides.PPImage.(Unknown Source:0)
at com.aspose.slides.ImageCollection.hj(Unknown Source:39)
at com.aspose.slides.kku.ip(Unknown Source:39)
at com.aspose.slides.kku.hj(Unknown Source:109)
at com.aspose.slides.rha.la(Unknown Source:34)
at com.aspose.slides.rha.hj(Unknown Source:90)
at com.aspose.slides.Presentation.la(Unknown Source:57)
at com.aspose.slides.Presentation.hj(Unknown Source:63)
at com.aspose.slides.Presentation.hj(Unknown Source:35)
at com.aspose.slides.Presentation.(Unknown Source:5)
at com.aspose.slides.Presentation.(Unknown Source:5)
at com.prowise.app.pptx_import_android.MainActivity.convertPPTXToPDF(MainActivity.kt:17)
at com.prowise.app.pptx_import_android.MainActivity.onCreate(MainActivity.kt:12)
at android.app.Activity.performCreate(Activity.java:8305)
at android.app.Activity.performCreate(Activity.java:8284)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3630)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3786)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2311)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7879)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:943)
Caused by: java.lang.NullPointerException: Attempt to read from field ‘com.aspose.slides.ms.backend.System.Drawing.gi com.aspose.slides.ms.backend.System.Drawing.GraphicsEnv.h8’ on a null object reference in method ‘com.aspose.slides.ms.backend.System.Drawing.gi com.aspose.slides.ms.backend.System.Drawing.GraphicsEnv.gi()’
at com.aspose.slides.ms.backend.System.Drawing.GraphicsEnv.gi(Unknown Source:4)
at com.aspose.slides.ms.backend.System.Drawing.gi.hj(Unknown Source:0)
at com.aspose.slides.internal.zw.te.(Unknown Source:3)
at com.aspose.slides.internal.zw.te.(Unknown Source:2)
at com.aspose.slides.PPImage.(Unknown Source:23)
at com.aspose.slides.PPImage.(Unknown Source:0)
at com.aspose.slides.ImageCollection.hj(Unknown Source:39)
at com.aspose.slides.kku.ip(Unknown Source:39)
at com.aspose.slides.kku.hj(Unknown Source:109)
at com.aspose.slides.rha.la(Unknown Source:34)
at com.aspose.slides.rha.hj(Unknown Source:90)
at com.aspose.slides.Presentation.la(Unknown Source:57)
at com.aspose.slides.Presentation.hj(Unknown Source:63)
at com.aspose.slides.Presentation.hj(Unknown Source:35)
at com.aspose.slides.Presentation.(Unknown Source:5)
at com.aspose.slides.Presentation.(Unknown Source:5)
at com.prowise.app.pptx_import_android.MainActivity.convertPPTXToPDF(MainActivity.kt:17)
at com.prowise.app.pptx_import_android.MainActivity.onCreate(MainActivity.kt:12)
at android.app.Activity.performCreate(Activity.java:8305)
at android.app.Activity.performCreate(Activity.java:8284)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1417)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3630)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3786)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:101)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2311)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7879)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:943)
The pptx file is zipped:
test.pptx.zip (395.7 KB)
The project (also containing the pptx file) is attached as zip:
pptx_import_android.zip (1.5 MB)
You still need to add the aspose-slides-24.12-android.via.java.jar to the libs folder (Needed to remove it because else the upload was to big).
Also I have removed the signing file because it is a specific key which is needed for my device.
We’ve already bought a license but this sample project doesn’t contain it. Also setting the license has issues with the system app.
I’ve the same problem as this topic, but this isn’t complete:
I’ve also looked into this ticket, but the solutions given here don’t work for me: