You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
I am trying to print string as pdf file In the Custom created PrintDocumnetAdapter. I am getting crash, when I create release build only. IT was working fine with the old Gradle version but after update Gradle version I am facing this issue.
java.lang.NullPointerException: Attempt to invoke virtual method 'void java.io.InputStream.close()' on a null object reference
at com.tom_roush.fontbox.ttf.MemoryTTFDataStream.<init>(MemoryTTFDataStream.java:56)
at com.tom_roush.fontbox.ttf.TTFParser.parse(TTFParser.java:108)
at com.tom_roush.pdfbox.pdmodel.font.PDType0Font.load(PDType0Font.java:98)
at com.jio.editor.MyPdfAdapter.getFont(MyPdfAdapter.java:189)
To reproduce
private PDFont getFont() {
PDDocument document = new PDDocument();
PDPage page = new PDPage(PDRectangle.A4);
document.addPage(page);
PDType0Font font = null;
try {
font = PDType0Font.load(document, PDDocument.class.getResourceAsStream("font/times.ttf"), true);
} catch (IOException e) {
e.printStackTrace();
}
return font;
}
Expected behavior
I dont know why its getting crash only when I use latest android gradle version but not crashing in old version " classpath 'com.android.tools.build:gradle:4.1.1'"
Describe the bug
I am trying to print string as pdf file In the Custom created PrintDocumnetAdapter. I am getting crash, when I create release build only. IT was working fine with the old Gradle version but after update Gradle version I am facing this issue.
To reproduce
Expected behavior
I dont know why its getting crash only when I use latest android gradle version but not crashing in old version " classpath 'com.android.tools.build:gradle:4.1.1'"
Environment details:
-gradle-wraper.property: = gradle-8.0-bin.zip
Here is the Windows system configuration:-
Java version: 18.0.2
Android studio version :Flamingo | 2022.2.1 Patch 2
The text was updated successfully, but these errors were encountered: