Coder Social home page Coder Social logo

Comments (33)

hashtaag-vinay-sasalatti avatar hashtaag-vinay-sasalatti commented on June 26, 2024 5

@barteksc Thanks for the new update it fixed my issues, good going ;P

Cheers
Vinay

from androidpdfviewer.

elerot avatar elerot commented on June 26, 2024 1

Did you check manifest file

android:hardwareAccelerated="false"

it should be true to fix

android:hardwareAccelerated="true"

from androidpdfviewer.

barteksc avatar barteksc commented on June 26, 2024

Please attach output from logcat, I will be able to analyze it

from androidpdfviewer.

JeanChristophePal avatar JeanChristophePal commented on June 26, 2024

The pdfView become blank, the logcat is solely:
" A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 20626"

After few second the app crash.

from androidpdfviewer.

Miha-x64 avatar Miha-x64 commented on June 26, 2024

I'm getting this sort of crash (and seldom SIGBUS or just UI freeze and SIGABRT) only if I'm trying to display two PDF files simultaneously.
(Unfortunately, I've got pages in separate files and forced to create a ViewPager populated with PDFViews)
I've made some locks that force PDFViews to work in series, but it works not so good.

Some fatal signals:
A/libc: Fatal signal 6 (SIGABRT) at 0x000001f6 (code=0), thread 14050 (*my package name without first letter*)

A/libc: Fatal signal 11 (SIGSEGV) at 0x00000002 (code=1), thread 14285 (*my package name without first letter*)

A/libc: Fatal signal 11 (SIGSEGV), thread 14563 (AsyncTask #1)
A/libc: Fatal signal 11 (SIGSEGV) at 0x00000002 (code=1), thread 14539 (*my package name without first letter*)

A/libc: Fatal signal 11 (SIGSEGV) at 0x00000007 (code=1), thread 25761 (*same*)

Addresses differ and may be 0xffffffff, 0x00000000, and others.

from androidpdfviewer.

hashtaag-vinay-sasalatti avatar hashtaag-vinay-sasalatti commented on June 26, 2024

hey @Miha-x64 i am doing the same functionality as you and getting a similar issue

A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xffffffc0 in tid 4027 (AsyncTask #2)

                                                       [ 06-24 17:37:03.683   304:  304 W/         ]
                                                       handle_request(10) debug_value = false;


                                                       [ 06-24 17:37:03.733   304:  304 W/         ]
                                                       wait_for_sigstope = 19

@barteksc any help would be very helpful

Thanks ;)

from androidpdfviewer.

niekvse avatar niekvse commented on June 26, 2024

Similar problem here, this occasionally happens, seemingly randomly:

06-24 17:01:41.521 15568-15568/com.xxxx.android.beta D/PdfViewActivity: Showing pdf file: /data/data/com.xxxx.android.beta/app_xxxx/Temp/pdfs/temp_pdf-1466780501469.pdf, size: 113509
06-24 17:01:41.521 15568-15721/com.xxxx.android.beta D/jniPdfium: Init FPDF library
06-24 17:01:41.581 15568-15721/com.xxxx.android.beta E/libc: mmap fail (pid 15568, tid 15721, size 113509, flags 0x2, errno 9(Bad file number))
06-24 17:01:41.581 15568-15721/com.xxxx.android.beta D/jniPdfium: File Size: 113509
06-24 17:01:42.022 15568-15721/com.xxxx.android.beta W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
06-24 17:01:42.022 15568-15721/com.xxxx.android.beta W/google-breakpad: Chrome build fingerprint:
06-24 17:01:42.022 15568-15721/com.xxxx.android.beta W/google-breakpad: 1.2.3
06-24 17:01:42.022 15568-15721/com.xxxx.android.beta W/google-breakpad: 7d26c012-4f20-450a-b207-c04dc7980276
06-24 17:01:42.022 15568-15721/com.xxxx.android.beta W/google-breakpad: ### ### ### ### ### ### ### ### ### ### ### ### ###
06-24 17:01:42.022 15568-15721/com.xxxx.android.beta A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xffffffff in tid 15721 (AsyncTask #4)
06-24 17:01:42.022 15568-15721/com.xxxx.android.beta W/libc: Security Level: (1), Debug inforamtion is controlled by the DUMPABLE flag.

from androidpdfviewer.

barteksc avatar barteksc commented on June 26, 2024

@Miha-x64 @hashtaag-vinay-sasalatti I know the reason of problem when using few PDFViews simultaneously, but it will be hard to fix.
AndroidPdfViewer uses PdfiumAndroid library which is custom compilation of Pdfium library for Android. Android Lollipop introduced PdfRenderer, which also uses Pdfium. If you are running AndroidPdfViewer on Lollipop and higher, its Pdfium library is replaced by built-in version of Pdfium. And there is no way to override system version of Pdfium. Probable solution is to compile Pdfium with different SONAME, but I'am not an expert in native code.

from androidpdfviewer.

hashtaag-vinay-sasalatti avatar hashtaag-vinay-sasalatti commented on June 26, 2024

@barteksc thanks for the library and the reply ,
i was just wondering and wanted to ask your input's for problem that i am facing here , please oblige ;P

i have 20 single pdfs which are download one by one from server , so i need to show these 20 files as they are downloaded one below the other , so my solution was i used JoanZapata/android-pdfview in a view pager for 20 items , so it did not have any crash but there was too much of rendering time required so i dropped the approach and tried this lib instead in view pager and its crashing so now i am in a mess ;P

just want to ask , if i can supply multiple pdfs to the pdfview so it shows them one below other , or can u help me with what view i need to use from the lib to render only one pdf in a recycler view or list view item :)

if not possible can u lead me to any approach where i can find a solution for this problem because i am unable to find help anywhere from more than a month .

any help will be appreciated @barteksc @JeanChristophePalyart @Miha-x64 @niekvse

Thanks
Vinay

from androidpdfviewer.

Miha-x64 avatar Miha-x64 commented on June 26, 2024

@barteksc, so, now we've got two problems — Segmentation Violation and SONAME that clashes with the system one?

from androidpdfviewer.

barteksc avatar barteksc commented on June 26, 2024

@Miha-x64 If you use Pdfium provided by PdfiumAndroid, few PDFViews can be used without problems, so there is only issue with SONAME.

from androidpdfviewer.

Miha-x64 avatar Miha-x64 commented on June 26, 2024

@barteksc, I'm getting

A/libc: Fatal signal 11 (SIGSEGV) at 0x00000007 (code=1), thread 16454 (*package*)

in my own SurfaceView with this dirty method:

public synchronized void fromFile(File file) {
    try {
        FileDescriptor fd = new FileInputStream(file).getFD();
        if (!fd.valid()) {
            Log.e("PdfView", "FileDescriptor is invalid.");
            return;
        }
        PdfDocument doc = pdfiumCore.newDocument(fd);
        Surface sur = getHolder().getSurface();
        if (sur == null) {
            Log.e("PdfView", "Surface is null");
            return;
        }
        pdfiumCore.openPage(doc, 0);
        pdfiumCore.renderPage(doc, sur, 0, 0, 0, getWidth(), getHeight()); // here
    } catch (IOException e) {
        throw new RuntimeException(e);
    }
}

on KitKat.
On not-first app run I see

D/dalvikvm: Shared lib '/data/app-lib/*my-package*-1/libpdfium.so' already loaded in same CL 0x42009318
D/dalvikvm: Shared lib '/data/app-lib/*my-package*-1/libjniPdfium.so' already loaded in same CL 0x42009318

in logs, but on first run I don't, so your libraries are getting loaded.

from androidpdfviewer.

macjay avatar macjay commented on June 26, 2024

I have got the same crash Fatal signal 11 (SIGSEGV), code 1, fault addr 0xffffffffffffff in tid 1327 (AsyncTask #3)
and i dont know how to fix it

from androidpdfviewer.

barteksc avatar barteksc commented on June 26, 2024

@Miha-x64 @hashtaag-vinay-sasalatti Please check version 1.1.2, it fixes using multiple PDFViews at the same time.
@JeanChristophePalyart @niekvse @macjay Please check version 1.1.2, it should help

from androidpdfviewer.

hashtaag-vinay-sasalatti avatar hashtaag-vinay-sasalatti commented on June 26, 2024

@barteksc Thanks for that , i will check and update you asap

Thanks ,
Vinay

from androidpdfviewer.

JeanChristophePal avatar JeanChristophePal commented on June 26, 2024

@barteksc I changed to version 1.1.2 and I still have problem with the this particular file. With others pdf files it ok.

(I'm testing on Elephone P60000 Pro Android 5.1, AP22)

from androidpdfviewer.

barteksc avatar barteksc commented on June 26, 2024

@JeanChristophePalyart Unfortunately I cannot reproduce this issue on any of my three devices (4.0.3, 4.2.1 and 5.0.1), documents opens without any problem. Could you try opening this file using built-in PdfRenderer (https://developer.android.com/reference/android/graphics/pdf/PdfRenderer.html)? There is also simple example available https://github.com/googlesamples/android-PdfRendererBasic

from androidpdfviewer.

macjay avatar macjay commented on June 26, 2024

@barteksc Thank you .I have update to 1.1.2,there is no problem in my nexus 5,but still have the problem in 魅蓝note2

from androidpdfviewer.

barteksc avatar barteksc commented on June 26, 2024

@macjay So, now we have serious problem. I cannot reproduce and therefore debug this issue. Please check if my previous post (with PdfRenderer) works for you

from androidpdfviewer.

Miha-x64 avatar Miha-x64 commented on June 26, 2024

@barteksc, thank you for your fix.
As it turns out, some sequences of PDFs work great and some are not.
They both have format version 1.6, but ones with the 'Author' field set to 'InDesign CS6 (Windows)' giving crash on Asus Nexus 5 (2012) 'grouper' (API 21). And all of them giving crash on my HTC Evo 3D 'shooteru' (API 19).

from androidpdfviewer.

barteksc avatar barteksc commented on June 26, 2024

@Miha-x64 Not good. It looks like pdfium itself may have some strange bugs...

from androidpdfviewer.

barteksc avatar barteksc commented on June 26, 2024

@hashtaag-vinay-sasalatti Yay, finally it works for someone ;)

from androidpdfviewer.

hashtaag-vinay-sasalatti avatar hashtaag-vinay-sasalatti commented on June 26, 2024

yes it worked for me and m one happy guy now , haha ;P

hey @barteksc i have observed one problem now (just want to improve) OnLoadCompleteListener is not giving me a correct callback after load complete (OR) maybe its displaying a white blank screen before the pdf is drawn , now here i need some inputs please

and one more thing is since i have 20 views in view pager and when i scroll back from 3rd to 1st position, again the pdf loads with a blink , how can i change it such that its already there ..

if any updates on my query please hit me back , but btw thats one awesome lib there .

Cheers ,
Vinay

from androidpdfviewer.

barteksc avatar barteksc commented on June 26, 2024

@hashtaag-vinay-sasalatti OnLoadCompleteListener is called after PDF file is loaded and ready to render on view, so you see white page for a while.
ViewPager adapter keeps 3 instances of pages - visible page, page to the left and page to the right. When you slide to next page, old left page is destroyed and new page to the right is instantiated. Keeping all 20 PDFViews in memory would quickly throw OutOfMemoryError exception. Thanks to the adapter behavior, you only keep 3 instances and when you scroll from 3rd to 1st page PDFView is loading and rendering document.

from androidpdfviewer.

hashtaag-vinay-sasalatti avatar hashtaag-vinay-sasalatti commented on June 26, 2024

@barteksc Ok thanks
but some times pdf won't load even after waiting for long time , this is my method below it is inside fragment item of view pager

private void showPdf(String filePath) {

        File PDF = new File(filePath);

        photoView.recycle();

        photoView.fromFile(PDF)
                .pages(0)
                .defaultPage(1)
                .showMinimap(false)
                .swipeVertical(false)
                .enableSwipe(false)
                .onDraw(new OnDrawListener() {
                    @Override
                    public void onLayerDrawn(Canvas canvas, float pageWidth, float pageHeight, int displayedPage) {

                    }
                })
                .onLoad(new OnLoadCompleteListener() {
                    @Override
                    public void loadComplete(int nbPages) {
                        progressBar.setVisibility(View.GONE);
                    }
                })
                .onPageChange(new OnPageChangeListener() {
                    @Override
                    public void onPageChanged(int page, int pageCount) {

                    }
                })
                .load();
    }

it won't load pdf sometimes , am i using it wrong ? sorry m troubling u many times :)

from androidpdfviewer.

JeanChristophePal avatar JeanChristophePal commented on June 26, 2024

@barteksc The document attached to my first post works with pdf Renderer. Therefor this one his limited to Lollipop.

To open "pdfSample.pdf" I'm doing

                    pdfView.fromFile(pdfFile)
                            .defaultPage(1)
                            .showMinimap(false)
                            .enableSwipe(true)
                            .onLoad(this)
                            .onPageChange(this)
                            .onError(new OnErrorListener() {
                                @Override
                                public void onError(Throwable t) {
                                    t.printStackTrace();
                                }
                            })
                            .load();

EDIT:
It's working on Android 4.2.2, 4.4.2, 6.0.1

EDIT 2:
Tried also on another mobile with Android 5.1 (Samsumg) and works. Finally only the Elephone crash on this particular file...

from androidpdfviewer.

Miha-x64 avatar Miha-x64 commented on June 26, 2024

@barteksc, with new version of the library there is no crash anymore. Thank you! :) 👍

from androidpdfviewer.

FAReact avatar FAReact commented on June 26, 2024

A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x94 in tid 11169 (package_name)

                                                     [ 10-14 06:59:26.001  1254: 1254 W/         ]
                                                     debuggerd: handling request: pid=11169 uid=10274 gid=10274 tid=11169

How can I fix it? Help I try to find answer on the Internent but I didn't find. Help me to fix this problem, it is on Android studio

from androidpdfviewer.

1stmetro avatar 1stmetro commented on June 26, 2024

Trace your steps back....

from androidpdfviewer.

1stmetro avatar 1stmetro commented on June 26, 2024

Sounds like a fragment issue....

from androidpdfviewer.

pritamsnkadiya avatar pritamsnkadiya commented on June 26, 2024

07-31 01:08:32.486 28994-28994/io.indoorlocation.navisens.demoapp A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x0 in tid 28994 (avisens.demoapp)

from androidpdfviewer.

SergeyBurlaka avatar SergeyBurlaka commented on June 26, 2024

Check last version guys. It fixed!

from androidpdfviewer.

pritamsnkadiya avatar pritamsnkadiya commented on June 26, 2024

#SergeyBurlaka, thank you so much for your reply but it's not fixed
error is !
screenshot from 2018-08-10 18-19-37

from androidpdfviewer.

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.