Comments (7)
@GohelAshok701 hi, iam getting error same as you, and trying to add android:requestLegacyExternalStorage="true"
but its still force close
2020-06-18 14:02:20.374 16575-16575/com.coba.htmltopdf E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.coba.htmltopdf, PID: 16575
java.lang.IllegalArgumentException: fd cannot be null
at ft.onWrite(chromium-TrichromeWebViewGoogle.apk-stable-410409683:28)
at android.print.PdfPrint$1.onLayoutFinished(PdfPrint.java:21)
at ft.onLayout(chromium-TrichromeWebViewGoogle.apk-stable-410409683:4)
at android.print.PdfPrint.print(PdfPrint.java:18)
at com.uttampanchasara.pdfgenerator.CreatePdf.savePdf(CreatePdf.kt:129)
at com.uttampanchasara.pdfgenerator.CreatePdf.access$savePdf(CreatePdf.kt:19)
at com.uttampanchasara.pdfgenerator.CreatePdf$create$1.onPageFinished(CreatePdf.kt:102)
at Fa.b(chromium-TrichromeWebViewGoogle.apk-stable-410409683:2)
at Cs.handleMessage(chromium-TrichromeWebViewGoogle.apk-stable-410409683:65)
at android.os.Handler.dispatchMessage(Handler.java:107)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7520)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
from pdf-generator.
@UttamPanchasara , Hope you doing well!
I am getting the same error despite adding android:requestLegacyExternalStorage="true" .
Running it on older device - Android 8.1.0
/PdfPrint: Failed to open ParcelFileDescriptor
java.io.IOException: No such file or directory
at java.io.UnixFileSystem.createFileExclusively0(Native Method)
at java.io.UnixFileSystem.createFileExclusively(UnixFileSystem.java:281)
at java.io.File.createNewFile(File.java:1000)
at android.print.PdfPrint.getOutputFile(PdfPrint.java:45)
at android.print.PdfPrint.access$000(PdfPrint.java:9)
at android.print.PdfPrint$1.onLayoutFinished(PdfPrint.java:21)
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.pdfmybills, PID: 30165
java.lang.IllegalArgumentException: fd cannot be null
at Ny0.onWrite(chromium-Monochrome.aab-stable-414708973:28)
at android.print.PdfPrint$1.onLayoutFinished(PdfPrint.java:21)
at Ny0.onLayout(chromium-Monochrome.aab-stable-414708973:4)
at android.print.PdfPrint.print(PdfPrint.java:18)
at com.uttampanchasara.pdfgenerator.CreatePdf.savePdf(CreatePdf.kt:129)
at com.uttampanchasara.pdfgenerator.CreatePdf.access$savePdf(CreatePdf.kt:19)
at com.uttampanchasara.pdfgenerator.CreatePdf$create$1.onPageFinished(CreatePdf.kt:102)
at oo.b(chromium-Monochrome.aab-stable-414708973:2)
at ky0.handleMessage(chromium-Monochrome.aab-stable-414708973:66)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6635)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
from pdf-generator.
I too had the same issue, I fixed the issue by changing the Gradle(app) compileSdkVersion from 30 to 29 and targetSdkVersion from 30 to 29.
Issue Fixed
from pdf-generator.
@UttamPanchasara Thanks for your response.
This issue getting due to Android Version 10.
Now fixed.
I have added the below line in manifest under the application tag.
android:requestLegacyExternalStorage="true"
Thanks.
from pdf-generator.
@GohelAshok701 Is it happening when you try to get pdf?
from pdf-generator.
Yes, but getting this issue on some devices.
Brand: realme
Model: realme 6Pro
Orientation: Portrait
RAM free: 3.83 GB
Disk free: 97.08 GB
Operating System
Version: 10
Orientation: Portrait
Rooted: No
from pdf-generator.
Thanks for the detail, I will verify the same
from pdf-generator.
Related Issues (20)
- need progress bar when generate pdf HOT 3
- Custom Paragraphs and RTL support HOT 1
- need to resize document HOT 1
- Can not create (Generate) Table HOT 1
- How can i cancel PDF on time of creating? HOT 3
- Using html tag and all data appending in StringBuffer but it does not compiling html tags HOT 1
- Library support CSS tag? HOT 8
- Cannot resolve symbol 'absolutePath' HOT 1
- create pdf from html HOT 1
- File saved as "namefile.pdf.pdf" HOT 1
- Save image HOT 1
- Can I render PDF from byte code from this library? If Yes, how can I do that. HOT 1
- Crash with error : No such file or directory PdfPrint HOT 3
- Question related to content HOT 1
- Converted PDF file saved with only one blank page HOT 1
- I like this one. Is there an IOS platform?
- Image not loading if targetsdk version is 30 HOT 1
- Not Working in SDK 33 HOT 1
- Can't import CreatePdf
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdf-generator.