GithubHelp home page GithubHelp logo

Comments (7)

pratamawijaya avatar pratamawijaya commented on June 1, 2024 5

@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.

Sanket911 avatar Sanket911 commented on June 1, 2024 3

@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.

Satishkumar591 avatar Satishkumar591 commented on June 1, 2024 2

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.

GohelAshok701 avatar GohelAshok701 commented on June 1, 2024 1

@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.

UttamPanchasara avatar UttamPanchasara commented on June 1, 2024

@GohelAshok701 Is it happening when you try to get pdf?

from pdf-generator.

GohelAshok701 avatar GohelAshok701 commented on June 1, 2024

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.

UttamPanchasara avatar UttamPanchasara commented on June 1, 2024

Thanks for the detail, I will verify the same

from pdf-generator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.