创建pdf文件后错误活动关闭

时间:2017-06-09 11:14:39

标签: android pdf itext

我正在尝试生成pdf。我也成功生成了PDF文件但是我的应用程序在创建pdf后仍然关闭。我搜索但没有找到任何答案。我按照这个链接 Creating a pdf file in android programmatically and writing in it   我不想关闭我的申请并在pdfviewer中查看pdf 这是我的代码

06-09 07:21:37.993 1334-1334/? E/libprocessgroup: failed to make and chown /acct/uid_10011: Read-only file system
06-09 07:21:37.993 1334-1334/? W/Zygote: createProcessGroup failed, kernel missing CONFIG_CGROUP_CPUACCT?
06-09 07:21:37.993 1334-1334/? I/art: Late-enabling -Xcheck:jni
06-09 07:21:38.058 1334-1334/Abc.com W/System: ClassLoader referenced unknown path: /data/app/Abc.com-1/lib/x86
06-09 07:21:38.231 1334-1353/Abc.com D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true

                                                              [ 06-09 07:21:38.236  1334: 1334 D/         ]
                                                              HostConnection::get() New Host Connection established 0xe9b1eb90, tid 1334
06-09 07:21:38.296 1334-1353/Abc.com D/libEGL: loaded /system/lib/egl/libEGL_emulation.so
06-09 07:21:38.297 1334-1353/Abc.com D/libEGL: loaded /system/lib/egl/libGLESv1_CM_emulation.so
06-09 07:21:38.310 1334-1353/Abc.com D/libEGL: loaded /system/lib/egl/libGLESv2_emulation.so

                                                      [ 06-09 07:21:38.329  1334: 1353 D/         ]
                                                      HostConnection::get() New Host Connection established 0xee952bc0, tid 1353
06-09 07:21:38.388 1334-1353/Abc.com I/OpenGLRenderer: Initialized EGL, version 1.4
06-09 07:21:38.464 1334-1353/Abc.com W/EGL_emulation: eglSurfaceAttrib not implemented
06-09 07:21:38.464 1334-1353/Abc.com W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xee9565a0, error=EGL_SUCCESS
06-09 07:21:42.143 1334-1334/Abc.com I/TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead.
06-09 07:21:42.149 1334-1334/Abc.com I/TextInputLayout: EditText added is not a TextInputEditText. Please switch to using that class instead.
06-09 07:21:42.225 1334-1353/Abc.com W/EGL_emulation: eglSurfaceAttrib not implemented
06-09 07:21:42.225 1334-1353/Abc.com W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xee956640, error=EGL_SUCCESS
06-09 07:21:42.633 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe8ec2150
06-09 07:21:52.584 1334-1353/Abc.com W/EGL_emulation: eglSurfaceAttrib not implemented
06-09 07:21:52.584 1334-1353/Abc.com W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xe9b3d840, error=EGL_SUCCESS
06-09 07:21:53.100 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe8ec2620
06-09 07:21:53.107 1334-1353/Abc.com D/OpenGLRenderer: endAllStagingAnimators on 0xde792000 (RippleDrawable) with handle 0xee952da0
06-09 07:21:54.178 1334-1353/Abc.com W/EGL_emulation: eglSurfaceAttrib not implemented
06-09 07:21:54.178 1334-1353/Abc.com W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xee9335c0, error=EGL_SUCCESS
06-09 07:21:54.885 1334-1334/Abc.com I/Choreographer: Skipped 39 frames!  The application may be doing too much work on its main thread.
06-09 07:21:55.172 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe9ba5920
06-09 07:21:56.128 1334-1334/Abc.com E/shape: HEART,
06-09 07:21:57.511 1334-1353/Abc.com W/EGL_emulation: eglSurfaceAttrib not implemented
06-09 07:21:57.511 1334-1353/Abc.com W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xde4491a0, error=EGL_SUCCESS
06-09 07:21:58.203 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe8ec2620
06-09 07:22:02.868 1334-1353/Abc.com W/EGL_emulation: eglSurfaceAttrib not implemented
06-09 07:22:02.868 1334-1353/Abc.com W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xe8d61480, error=EGL_SUCCESS
06-09 07:22:02.927 1334-1353/Abc.com W/EGL_emulation: eglSurfaceAttrib not implemented
06-09 07:22:02.927 1334-1353/Abc.com W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xe8d613a0, error=EGL_SUCCESS
06-09 07:22:02.946 1334-1334/Abc.com E/RecyclerView: No adapter attached; skipping layout
06-09 07:22:03.136 1334-1334/Abc.com E/RecyclerView: No adapter attached; skipping layout
06-09 07:22:03.193 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe9ba5920
06-09 07:22:03.371 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe8ec2770
06-09 07:22:03.602 1334-1353/Abc.com W/EGL_emulation: eglSurfaceAttrib not implemented
06-09 07:22:03.602 1334-1353/Abc.com W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xde257ec0, error=EGL_SUCCESS
06-09 07:22:04.094 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe8ec2620
06-09 07:22:06.009 1334-1334/Abc.com I/art: Rejecting re-init on previously-failed class java.lang.Class<com.itextpdf.awt.PdfGraphics2D>
06-09 07:22:06.009 1334-1334/Abc.com I/art: Rejecting re-init on previously-failed class java.lang.Class<com.itextpdf.awt.PdfGraphics2D>
06-09 07:22:06.009 1334-1334/Abc.com I/art: Rejecting re-init on previously-failed class java.lang.Class<com.itextpdf.awt.PdfGraphics2D>
06-09 07:22:06.009 1334-1334/Abc.com I/art: Rejecting re-init on previously-failed class java.lang.Class<com.itextpdf.awt.PdfGraphics2D>
06-09 07:22:06.009 1334-1334/Abc.com I/art: Rejecting re-init on previously-failed class java.lang.Class<com.itextpdf.awt.PdfGraphics2D>
06-09 07:22:06.009 1334-1334/Abc.com I/art: Rejecting re-init on previously-failed class java.lang.Class<com.itextpdf.awt.PdfGraphics2D>
06-09 07:22:06.010 1334-1334/Abc.com I/art: Rejecting re-init on previously-failed class java.lang.Class<com.itextpdf.awt.PdfGraphics2D>
06-09 07:22:06.010 1334-1334/Abc.com I/art: Rejecting re-init on previously-failed class java.lang.Class<com.itextpdf.awt.PdfGraphics2D>
06-09 07:22:06.010 1334-1334/Abc.com I/art: Rejecting re-init on previously-failed class java.lang.Class<com.itextpdf.awt.PdfPrinterGraphics2D>
06-09 07:22:06.010 1334-1334/Abc.com I/art: Rejecting re-init on previously-failed class java.lang.Class<com.itextpdf.awt.PdfPrinterGraphics2D>
06-09 07:22:06.011 1334-1334/Abc.com I/art: Rejecting re-init on previously-failed class java.lang.Class<com.itextpdf.awt.PdfPrinterGraphics2D>
06-09 07:22:06.011 1334-1334/Abc.com I/art: Rejecting re-init on previously-failed class java.lang.Class<com.itextpdf.awt.PdfPrinterGraphics2D>
06-09 07:22:06.012 1334-1334/Abc.com I/art: Rejecting re-init on previously-failed class java.lang.Class<com.itextpdf.awt.PdfPrinterGraphics2D>
06-09 07:22:06.013 1334-1334/Abc.com I/art: Rejecting re-init on previously-failed class java.lang.Class<com.itextpdf.awt.PdfPrinterGraphics2D>
06-09 07:22:06.017 1334-1334/Abc.com I/art: Rejecting re-init on previously-failed class java.lang.Class<com.itextpdf.awt.PdfPrinterGraphics2D>
06-09 07:22:06.242 1334-1353/Abc.com W/EGL_emulation: eglSurfaceAttrib not implemented
06-09 07:22:06.242 1334-1353/Abc.com W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xde0bd5c0, error=EGL_SUCCESS
06-09 07:22:06.401 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe8ec2380
06-09 07:22:06.409 1334-1353/Abc.com D/OpenGLRenderer: endAllStagingAnimators on 0xde146600 (RippleDrawable) with handle 0xe8d3b660
06-09 07:22:09.669 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe8ec2150
06-09 07:22:16.830 1334-1353/Abc.com W/EGL_emulation: eglSurfaceAttrib not implemented
06-09 07:22:16.830 1334-1353/Abc.com W/OpenGLRenderer: Failed to set EGL_SWAP_BEHAVIOR on surface 0xe8d614a0, error=EGL_SUCCESS

这个logcat:

06-09 07:21:37.993 1334-1334/? E/libprocessgroup: failed to make and chown /acct/uid_10011: Read-only file system
06-09 07:21:42.633 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe8ec2150
06-09 07:21:53.100 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe8ec2620
06-09 07:21:55.172 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe9ba5920
06-09 07:21:56.128 1334-1334/Abc.com E/shape: HEART,
06-09 07:21:58.203 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe8ec2620
06-09 07:22:02.946 1334-1334/Abc.com E/RecyclerView: No adapter attached; skipping layout
06-09 07:22:03.136 1334-1334/Abc.com E/RecyclerView: No adapter attached; skipping layout
06-09 07:22:03.193 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe9ba5920
06-09 07:22:03.371 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe8ec2770
06-09 07:22:04.094 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe8ec2620
06-09 07:22:06.401 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe8ec2380
06-09 07:22:09.669 1334-1353/Abc.com E/Surface: getSlotFromBufferLocked: unknown buffer: 0xe8ec2150

这里是错误Logcat:

@ConditionalOnExpression(#{propertyobject.getexenabled()})
class ex1{

}

1 个答案:

答案 0 :(得分:0)

在你的日志中我看到这一行:

06-09 07:22:06.009 1334-1334/Abc.com I/art: Rejecting re-init on previously-failed class java.lang.Class<com.itextpdf.awt.PdfGraphics2D>

注意awt。 AWT是Java的一部分,在Android上不可用。您正在使用iText for Java(哪个版本???)但您应该使用Android端口,而不是iTextG。它在功能上与iText完全相同,但在Android上无法使用所有已删除的内容。

iTextG可在Maven Central上使用:https://mvnrepository.com/artifact/com.itextpdf/itextg 所以你可以在Gradle中使用它,或者你最喜欢的构建系统。