question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PDF Doesn't show on SDK 30 -> Android 10

See original GitHub issue

Hi, The pdf stopped showing after I targeted SDK 30. does this library support sdk 30? if yes, what change i need to do?

The pdf doesn’t show when run on Android 10

my code:

` Uri path = Uri.fromFile(pdfFile);

        pdfViewer.fromUri(path)
                .password(null)
                .defaultPage(0)
                .enableSwipe(true)
                .swipeHorizontal(false)
                .enableDoubletap(true)
                .spacing(0)
                .enableAnnotationRendering(false)
                .load();

`

thanks

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:9

github_iconTop GitHub Comments

1reaction
Biplab-Roycommented, Jan 23, 2021
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.graphics.drawable.Drawable.draw(android.graphics.Canvas)' on a null object reference
    at com.ahmer.afzal.pdfviewer.PDFView.onDraw(PDFView.java:592)
    at android.view.View.draw(View.java:20234)
    at android.view.View.updateDisplayListIfDirty(View.java:19109)
    at android.view.View.draw(View.java:19962)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4337)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4114)
    at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1975)
    at android.view.View.updateDisplayListIfDirty(View.java:19100)
    at android.view.View.draw(View.java:19962)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4337)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4114)
    at android.view.View.updateDisplayListIfDirty(View.java:19100)
    at android.view.View.draw(View.java:19962)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4337)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4114)
    at android.view.View.updateDisplayListIfDirty(View.java:19100)
    at android.view.View.draw(View.java:19962)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4337)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4114)
    at android.view.View.updateDisplayListIfDirty(View.java:19100)
    at android.view.View.draw(View.java:19962)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4337)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4114)
    at android.view.View.updateDisplayListIfDirty(View.java:19100)
    at android.view.View.draw(View.java:19962)
    at android.view.ViewGroup.drawChild(ViewGroup.java:4337)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4114)
    at android.view.View.draw(View.java:20237)
    at com.android.internal.policy.DecorView.draw(DecorView.java:784)
    at android.view.View.updateDisplayListIfDirty(View.java:19109)
    at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:686)
    at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:692)
    at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:801)
    at android.view.ViewRootImpl.draw(ViewRootImpl.java:3373)
    at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:3163)
    at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2532)
    at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1505)
    at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:7354)
    at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1092)
    at android.view.Choreographer.doCallbacks(Choreographer.java:888)
    at android.view.Choreographer.doFrame(Choreographer.java:819)
    at android.view.Choreographer$FrameHandler.handleMessage(Choreographer.java:991)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:201)
    at android.app.ActivityThread.main(ActivityThread.java:6810)
    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:873)

For SDK 28 I used @AhmerAfzal1 library but any other error I am getting. While for same code @barteksc Library working perfect.

0reactions
islamYMansourcommented, Dec 22, 2021

@AhmerAfzal1 if face the same problem and I try to use your library but it crashes like Biplab-Roy

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to list PDF in android 10 Api level 30? - Stack Overflow
Show activity on this post. like this, just query all the files, and display the ones ending with ".pdf" check the answer below....
Read more >
Saving pdf file doesn't work on Android 10 - Syncfusion
Saving pdf file doesn't work on Android 10 ... The example project is working fine while using Android 9, however it doesn't work...
Read more >
Android storage use cases and best practices
Show image or video files from multiple folders; Show images or videos from ... If your app targets Android 10 (API level 29),...
Read more >
Use of All files access (MANAGE_EXTERNAL_STORAGE ...
This is only applicable to apps that target Android 11 (API level 30) and declare the MANAGE_EXTERNAL_STORAGE permission, which is added in Android...
Read more >
Troubleshoot viewing PDF files on the web - Adobe Support
To solve common PDF-display issues, follow the instructions in the order ... If you don't see the Adobe PDF Reader add-on, try the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found