AndroidPdfViewer icon indicating copy to clipboard operation
AndroidPdfViewer copied to clipboard

[BUG] libmodft2.so not 16 KB aligned (causes crash on ARM64 devices)

Open technicalamanpandit opened this issue 8 months ago • 16 comments

Issue Description
The native library arm64-v8a/libmodft2.so (from pdfium-android:1.9.0) is not 16 KB aligned, causing crashes on newer Android devices that enforce 16 KB page alignment.

Error Log

java.lang.UnsatisfiedLinkError: No implementation found for long com.shockwave.pdfium.PdfiumCore.nativeOpenDocument(int, java.lang.String) at com.shockwave.pdfium.PdfiumCore.nativeOpenDocument(Native Method) at com.shockwave.pdfium.PdfiumCore.newDocument(PdfiumCore.java:135) at com.github.barteksc.pdfviewer.source.AssetSource.createDocument(AssetSource.java:41) ...

technicalamanpandit avatar Jun 30 '25 08:06 technicalamanpandit

I also have same issue. Is there any other 16 KB page size compatible pdf viewer lib for android?

asadwaheed1 avatar Jul 01 '25 11:07 asadwaheed1

We are also searching but not getting it. We tried to fix it but could not succeed. If you find any solution for this then please tell us also.

On Tue, 1 Jul 2025, 5:22 pm Asad Waheed, @.***> wrote:

asadwaheed1 left a comment (DImuthuUpe/AndroidPdfViewer#1229) https://github.com/DImuthuUpe/AndroidPdfViewer/issues/1229#issuecomment-3023650242

I also have same issue. Is there any other 16 KB page size compatible pdf viewer lib for android?

— Reply to this email directly, view it on GitHub https://github.com/DImuthuUpe/AndroidPdfViewer/issues/1229#issuecomment-3023650242, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5JGNCEQE5VH546N3TLDG4T3GJZA5AVCNFSM6AAAAACANQMZCCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMRTGY2TAMRUGI . You are receiving this because you authored the thread.Message ID: @.***>

technicalamanpandit avatar Jul 01 '25 12:07 technicalamanpandit

I meet the same issue

PeaceAllen avatar Jul 03 '25 09:07 PeaceAllen

maybe? https://github.com/barteksc/PdfiumAndroid/issues/95

PeaceAllen avatar Jul 03 '25 09:07 PeaceAllen

Found a compatible lib

asadwaheed1 avatar Jul 03 '25 12:07 asadwaheed1

this one works implementation 'io.github.oothp:android-pdf-viewer:3.2.0-beta05'

asadwaheed1 avatar Jul 03 '25 12:07 asadwaheed1

this one works implementation 'io.github.oothp:android-pdf-viewer:3.2.0-beta05'

You are a hero asadwaheed1! Thank you so much!

iNeoTroniC avatar Jul 03 '25 14:07 iNeoTroniC

🙏 Thank you so much @asadwaheed1!

The library you suggested: implementation("io.github.oothp:android-pdf-viewer:3.2.0-beta05") works perfectly and resolves the 16KB native page size issue ✅

Also, the documentation and setup instructions available here were really helpful: 🔗 https://libraries.io/maven/io.github.oothp:android-pdf-viewer

Thanks again for pointing this out — it saved me a lot of time. Much appreciated! 🙌

technicalamanpandit avatar Jul 03 '25 14:07 technicalamanpandit

Just another problem:

When using implementation 'io.github.oothp:android-pdf-viewer:3.2.0-beta05' my styles getting overidden, e.g. colorAccent is used from the library instead of my app...

(correcting the resources at https://github.com/oothp/AndroidPdfViewer/tree/master fixed the problem...)

iNeoTroniC avatar Jul 03 '25 14:07 iNeoTroniC

@iNeoTroniC Good work. So have you published your fixes in a public repo which we can use?

asadwaheed1 avatar Jul 04 '25 06:07 asadwaheed1

I decided to fix it myself here's the bug free version

implementation 'com.github.asadwaheed1:AndroidPdfViewer:v3.2.0-beta06'

asadwaheed1 avatar Jul 04 '25 10:07 asadwaheed1

Which bug has been fixed in this

On Fri, 4 Jul 2025, 3:57 pm Asad Waheed, @.***> wrote:

asadwaheed1 left a comment (DImuthuUpe/AndroidPdfViewer#1229) https://github.com/DImuthuUpe/AndroidPdfViewer/issues/1229#issuecomment-3035425078

I decided to fix it myself here's the bug free version

implementation 'com.github.asadwaheed1:AndroidPdfViewer:v3.2.0-beta06'

— Reply to this email directly, view it on GitHub https://github.com/DImuthuUpe/AndroidPdfViewer/issues/1229#issuecomment-3035425078, or unsubscribe https://github.com/notifications/unsubscribe-auth/A5JGNCHMURSQMKSKAAEHWH33GZJI3AVCNFSM6AAAAACANQMZCCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTAMZVGQZDKMBXHA . You are receiving this because you authored the thread.Message ID: @.***>

technicalamanpandit avatar Jul 04 '25 10:07 technicalamanpandit

@technicalamanpandit this one

When using implementation 'io.github.oothp:android-pdf-viewer:3.2.0-beta05' my styles getting overidden, e.g. colorAccent is used from the library instead of my app...

asadwaheed1 avatar Jul 04 '25 11:07 asadwaheed1

this one works implementation 'io.github.oothp:android-pdf-viewer:3.2.0-beta05'

Great!! Thanks , asadwaheed1.

jlsogorb avatar Jul 05 '25 11:07 jlsogorb

io.github.oothp:android-pdf-viewer:3.2.0-beta05 solved the 16k issue, but the signature cannot be displayed。Do you have a solution?

wyc1411162011 avatar Sep 01 '25 09:09 wyc1411162011

🙏 Thank you so much @asadwaheed1!

The library you suggested: implementation("io.github.oothp:android-pdf-viewer:3.2.0-beta05") works perfectly and resolves the 16KB native page size issue ✅

Also, the documentation and setup instructions available here were really helpful: 🔗 https://libraries.io/maven/io.github.oothp:android-pdf-viewer

Thanks again for pointing this out — it saved me a lot of time. Much appreciated! 🙌

Play Store is showing a ‘16KB native page size issue’. Will it be fixed if I add this? Please reply.

RUHULRUHUL avatar Nov 03 '25 10:11 RUHULRUHUL