Не удается открыть ошибки zip-файла, приводящие к ошибке 1.not.found.as.resource с помощью iTextG - PullRequest
0 голосов
/ 24 ноября 2018

Мое приложение иногда падает с сообщением об ошибке, показанным ниже.Он не может найти некоторые файлы .apk (некоторые из которых мне пришлось опустить, чтобы соответствовать текстовому ограничению), а затем iText выдает ошибку 1.not.found.as.resource, которая, я думаю, происходит из-за невозможности найти эти файлы.Я пытался сделать кеш недействительным и перезапустить, но сбой все равно будет происходить время от времени.Я просто не знаю, как они были удалены или как их исправить.Я также не уверен, как это могло бы работать большую часть времени, а затем так и происходить сбой только время от времени.Как он может найти файлы в одном экземпляре, но не в другом?

11-22 19:30:27.883  8114  8114 E System  : Unable to open zip file: /data/app/testapp.dipsheetcreator-Z1HJ7fu5_gAR7OuwuDIw8g==/base.apk
11-22 19:30:27.885  8114  8114 E System  : java.io.FileNotFoundException: File doesn't exist: /data/app/testapp.dipsheetcreator-Z1HJ7fu5_gAR7OuwuDIw8g==/base.apk
11-22 19:30:27.885  8114  8114 E System  :  at java.util.zip.ZipFile.<init>(ZipFile.java:212)
11-22 19:30:27.885  8114  8114 E System  :  at java.util.zip.ZipFile.<init>(ZipFile.java:149)
11-22 19:30:27.885  8114  8114 E System  :  at java.util.jar.JarFile.<init>(JarFile.java:160)
11-22 19:30:27.885  8114  8114 E System  :  at java.util.jar.JarFile.<init>(JarFile.java:97)
11-22 19:30:27.885  8114  8114 E System  :  at libcore.io.ClassPathURLStreamHandler.<init>(ClassPathURLStreamHandler.java:47)
11-22 19:30:27.885  8114  8114 E System  :  at dalvik.system.DexPathList$Element.maybeInit(DexPathList.java:655)
11-22 19:30:27.885  8114  8114 E System  :  at dalvik.system.DexPathList$Element.findResource(DexPathList.java:682)
11-22 19:30:27.885  8114  8114 E System  :  at dalvik.system.DexPathList.findResource(DexPathList.java:488)
11-22 19:30:27.885  8114  8114 E System  :  at dalvik.system.BaseDexClassLoader.findResource(BaseDexClassLoader.java:112)
11-22 19:30:27.885  8114  8114 E System  :  at java.lang.ClassLoader.getResource(ClassLoader.java:793)
11-22 19:30:27.885  8114  8114 E System  :  at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:987)
11-22 19:30:27.885  8114  8114 E System  :  at com.itextpdf.text.io.StreamUtil.getResourceStream(StreamUtil.java:117)
11-22 19:30:27.885  8114  8114 E System  :  at com.itextpdf.text.pdf.Type1Font.<init>(Type1Font.java:187)
11-22 19:30:27.885  8114  8114 E System  :  at com.itextpdf.text.pdf.BaseFont.createFont(BaseFont.java:700)
11-22 19:30:27.885  8114  8114 E System  :  at com.itextpdf.text.pdf.BaseFont.createFont(BaseFont.java:625)
11-22 19:30:27.885  8114  8114 E System  :  at com.itextpdf.text.FontFactoryImp.getBaseFont(FontFactoryImp.java:214)
11-22 19:30:27.885  8114  8114 E System  :  at com.itextpdf.text.FontFactoryImp.getFont(FontFactoryImp.java:189)
11-22 19:30:27.885  8114  8114 E System  :  at com.itextpdf.text.FontFactoryImp.getFont(FontFactoryImp.java:143)
11-22 19:30:27.885  8114  8114 E System  :  at com.itextpdf.text.FontFactory.getFont(FontFactory.java:131)
11-22 19:30:27.885  8114  8114 E System  :  at com.itextpdf.text.FontFactory.getFont(FontFactory.java:259)
11-22 19:30:27.885  8114  8114 E System  :  at testapp.dipsheetgenerator.ViewPDF.addMainTable(ViewPDF.java:941)
11-22 19:30:27.885  8114  8114 E System  :  at testapp.dipsheetgenerator.ViewPDF.createPDF(ViewPDF.java:2984)
11-22 19:30:27.885  8114  8114 E System  :  at testapp.dipsheetgenerator.ViewPDF.onCreate(ViewPDF.java:235)
11-22 19:30:27.885  8114  8114 E System  :  at android.app.Activity.performCreate(Activity.java:7183)
11-22 19:30:27.885  8114  8114 E System  :  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
11-22 19:30:27.885  8114  8114 E System  :  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2908)
11-22 19:30:27.885  8114  8114 E System  :  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030)
11-22 19:30:27.885  8114  8114 E System  :  at android.app.ActivityThread.-wrap11(Unknown Source:0)
11-22 19:30:27.885  8114  8114 E System  :  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
11-22 19:30:27.885  8114  8114 E System  :  at android.os.Handler.dispatchMessage(Handler.java:105)
11-22 19:30:27.885  8114  8114 E System  :  at android.os.Looper.loop(Looper.java:164)
11-22 19:30:27.885  8114  8114 E System  :  at android.app.ActivityThread.main(ActivityThread.java:6938)
11-22 19:30:27.885  8114  8114 E System  :  at java.lang.reflect.Method.invoke(Native Method)
11-22 19:30:27.885  8114  8114 E System  :  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
11-22 19:30:27.885  8114  8114 E System  :  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
11-22 19:30:27.895  8114  8114 E System  : Unable to open zip file: /data/app/testapp.dipsheetcreator-Z1HJ7fu5_gAR7OuwuDIw8g==/split_lib_slice_9_apk.apk
11-22 19:30:27.895  8114  8114 E System  : java.io.FileNotFoundException: File doesn't exist: /data/app/testapp.dipsheetcreator-Z1HJ7fu5_gAR7OuwuDIw8g==/split_lib_slice_9_apk.apk
11-22 19:30:27.895  8114  8114 E System  :  at java.util.zip.ZipFile.<init>(ZipFile.java:212)
11-22 19:30:27.895  8114  8114 E System  :  at java.util.zip.ZipFile.<init>(ZipFile.java:149)
11-22 19:30:27.895  8114  8114 E System  :  at java.util.jar.JarFile.<init>(JarFile.java:160)
11-22 19:30:27.895  8114  8114 E System  :  at java.util.jar.JarFile.<init>(JarFile.java:97)
11-22 19:30:27.895  8114  8114 E System  :  at libcore.io.ClassPathURLStreamHandler.<init>(ClassPathURLStreamHandler.java:47)
11-22 19:30:27.895  8114  8114 E System  :  at dalvik.system.DexPathList$Element.maybeInit(DexPathList.java:655)
11-22 19:30:27.895  8114  8114 E System  :  at dalvik.system.DexPathList$Element.findResource(DexPathList.java:682)
11-22 19:30:27.895  8114  8114 E System  :  at dalvik.system.DexPathList.findResource(DexPathList.java:488)
11-22 19:30:27.895  8114  8114 E System  :  at dalvik.system.BaseDexClassLoader.findResource(BaseDexClassLoader.java:112)
11-22 19:30:27.895  8114  8114 E System  :  at java.lang.ClassLoader.getResource(ClassLoader.java:793)
11-22 19:30:27.895  8114  8114 E System  :  at java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:987)
11-22 19:30:27.895  8114  8114 E System  :  at com.itextpdf.text.io.StreamUtil.getResourceStream(StreamUtil.java:117)
11-22 19:30:27.895  8114  8114 E System  :  at com.itextpdf.text.pdf.Type1Font.<init>(Type1Font.java:187)
11-22 19:30:27.895  8114  8114 E System  :  at com.itextpdf.text.pdf.BaseFont.createFont(BaseFont.java:700)
11-22 19:30:27.895  8114  8114 E System  :  at com.itextpdf.text.pdf.BaseFont.createFont(BaseFont.java:625)
11-22 19:30:27.895  8114  8114 E System  :  at com.itextpdf.text.FontFactoryImp.getBaseFont(FontFactoryImp.java:214)
11-22 19:30:27.895  8114  8114 E System  :  at com.itextpdf.text.FontFactoryImp.getFont(FontFactoryImp.java:189)
11-22 19:30:27.895  8114  8114 E System  :  at com.itextpdf.text.FontFactoryImp.getFont(FontFactoryImp.java:143)
11-22 19:30:27.895  8114  8114 E System  :  at com.itextpdf.text.FontFactory.getFont(FontFactory.java:131)
11-22 19:30:27.895  8114  8114 E System  :  at com.itextpdf.text.FontFactory.getFont(FontFactory.java:259)
11-22 19:30:27.895  8114  8114 E System  :  at testapp.dipsheetgenerator.ViewPDF.addMainTable(ViewPDF.java:941)
11-22 19:30:27.895  8114  8114 E System  :  at testapp.dipsheetgenerator.ViewPDF.createPDF(ViewPDF.java:2984)
11-22 19:30:27.895  8114  8114 E System  :  at testapp.dipsheetgenerator.ViewPDF.onCreate(ViewPDF.java:235)
11-22 19:30:27.895  8114  8114 E System  :  at android.app.Activity.performCreate(Activity.java:7183)
11-22 19:30:27.895  8114  8114 E System  :  at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
11-22 19:30:27.895  8114  8114 E System  :  at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2908)
11-22 19:30:27.895  8114  8114 E System  :  at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030)
11-22 19:30:27.895  8114  8114 E System  :  at android.app.ActivityThread.-wrap11(Unknown Source:0)
11-22 19:30:27.895  8114  8114 E System  :  at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
11-22 19:30:27.895  8114  8114 E System  :  at android.os.Handler.dispatchMessage(Handler.java:105)
11-22 19:30:27.895  8114  8114 E System  :  at android.os.Looper.loop(Looper.java:164)
11-22 19:30:27.895  8114  8114 E System  :  at android.app.ActivityThread.main(ActivityThread.java:6938)
11-22 19:30:27.895  8114  8114 E System  :  at java.lang.reflect.Method.invoke(Native Method)
11-22 19:30:27.895  8114  8114 E System  :  at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
11-22 19:30:27.895  8114  8114 E System  :  at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
11-22 19:30:27.915  8114  8114 W System.err: No message found for 1.not.found.as.resource
11-22 19:30:27.919  8114  8114 W System.err: No message found for 1.not.found.as.resource
11-22 19:30:27.920  8114  8114 D AndroidRuntime: Shutting down VM
11-22 19:30:27.921  8114  8114 E AndroidRuntime: FATAL EXCEPTION: main
11-22 19:30:27.921  8114  8114 E AndroidRuntime: Process: testapp.dipsheetcreator, PID: 8114
11-22 19:30:27.921  8114  8114 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{testapp.dipsheetcreator/testapp.dipsheetgenerator.ViewPDF}: ExceptionConverter: com.itextpdf.text.DocumentException: No message found for 1.not.found.as.resource
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2955)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at android.app.ActivityThread.-wrap11(Unknown Source:0)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:105)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:164)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6938)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
11-22 19:30:27.921  8114  8114 E AndroidRuntime: Caused by: ExceptionConverter: com.itextpdf.text.DocumentException: No message found for 1.not.found.as.resource
11-22 19:30:27.921  8114  8114 E AndroidRuntime: Caused by: com.itextpdf.text.DocumentException: No message found for 1.not.found.as.resource
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at com.itextpdf.text.pdf.Type1Font.<init>(Type1Font.java:191)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at com.itextpdf.text.pdf.BaseFont.createFont(BaseFont.java:700)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at com.itextpdf.text.pdf.BaseFont.createFont(BaseFont.java:625)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at com.itextpdf.text.pdf.BaseFont.createFont(BaseFont.java:568)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at com.itextpdf.text.FontFactoryImp.getBaseFont(FontFactoryImp.java:222)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at com.itextpdf.text.FontFactoryImp.getFont(FontFactoryImp.java:189)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at com.itextpdf.text.FontFactoryImp.getFont(FontFactoryImp.java:143)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at com.itextpdf.text.FontFactory.getFont(FontFactory.java:131)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at com.itextpdf.text.FontFactory.getFont(FontFactory.java:259)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at testapp.dipsheetgenerator.ViewPDF.addMainTable(ViewPDF.java:941)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at testapp.dipsheetgenerator.ViewPDF.createPDF(ViewPDF.java:2984)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at testapp.dipsheetgenerator.ViewPDF.onCreate(ViewPDF.java:235)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at android.app.Activity.performCreate(Activity.java:7183)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2908)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3030)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at android.app.ActivityThread.-wrap11(Unknown Source:0)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at android.os.Handler.dispatchMessage(Handler.java:105)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at android.os.Looper.loop(Looper.java:164)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at android.app.ActivityThread.main(ActivityThread.java:6938)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at java.lang.reflect.Method.invoke(Native Method)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
11-22 19:30:27.921  8114  8114 E AndroidRuntime:    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
...