afreakyelf / Pdf-Viewer

A Lightweight PDF Viewer Android library which only occupies around 80kb while most of the Pdf viewer occupies up to 16MB space.
https://afreakyelf.github.io/Pdf-Viewer/
MIT License
821 stars 173 forks source link

App Crashing #73

Closed hemrajKumawat1 closed 1 year ago

hemrajKumawat1 commented 1 year ago

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.rsmssb.oldpaper/com.rajat.pdfviewer.PdfViewerActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ProgressBar.setVisibility(int)' on a null object reference

and using this

implementation 'com.github.afreakyelf:Pdf-Viewer:1.1.2'

startActivity(PdfViewerActivity.Companion.launchPdfFromUrl(PdfViewer.this, path, "PDF", "", false) .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK));

github-actions[bot] commented 1 year ago

Thank you for creating your first issue. We appreciate your help in making this project better. We will look into it, and get back to you soon.

eduyash09 commented 1 year ago

Any updates, or this library is deprecated?

afreakyelf commented 1 year ago

Hi, Thank you for using this library. Above issue has been fixed in latest version. https://github.com/afreakyelf/Pdf-Viewer/releases/tag/v2.0.1

IlhomSh commented 7 months ago

Hello, I have the same error!

version I have v2.0.5 Caused by java.lang.NullPointerException: at com.rajat.pdfviewer.PdfViewerActivity.onCreate(PdfViewerActivity.kt:226)

         content.pdfPreview.initWithUrl(
        arg.path,

        lifecycleCoroutineScope = lifecycleScope,
        lifecycle = lifecycle
    )