react-native-pdf icon indicating copy to clipboard operation
react-native-pdf copied to clipboard

libpdfiumandroid.so not 16 KB aligned – Google Play 16 KB page-size requirement

Open Pradhyuman-nosnia opened this issue 1 year ago • 30 comments

Google Play now requires all native libraries to support 16 KB memory page-size alignment (mandatory for updates from Nov 1, 2025).

When analyzing my APK built with react-native-pdf, I found that:

  • base/lib/arm64-v8a/libpdfiumandroid.so
  • base/lib/x86_64/libpdfiumandroid.so

are still built with 4 KB alignment instead of 16 KB.
This causes Google Play Console warnings and will block publishing on newer devices.

Steps to reproduce:

  1. Build app with react-native-pdf
  2. Analyze APK/AAB → check libpdfiumandroid.so
  3. Shows Align 0x1000 (4096) instead of required Align 0x4000 (16384)

Expected behavior: libpdfiumandroid.so should be rebuilt with NDK r28+ to support 16 KB alignment.

Please update the bundled binaries so apps using this library can pass Google Play compliance.

Pradhyuman-nosnia avatar Aug 28 '25 05:08 Pradhyuman-nosnia

+1

kapilislive avatar Aug 28 '25 07:08 kapilislive

+1

billbtruelio avatar Aug 28 '25 17:08 billbtruelio

+1

Stan-1904 avatar Aug 28 '25 19:08 Stan-1904

This was fixed in this PR: https://github.com/wonday/react-native-pdf/pull/950

It is merged to the master branch but has not been released in a new package version.

It you cannot wait for a new version you can use patch-package to apply the diff from the PR yourself.

The current master branch raises errors (related comment - https://github.com/wonday/react-native-pdf/commit/b0b074fc60c86c4f2e10deab6676d7c2a15be43d#commitcomment-164691008).

  • Using io.legere:pdfiumandroid:1.0.33 throws error java.lang.IllegalArgumentException: source must not be null
  • And another error is 'The binary version of its metadata is 2.0.0, expected version is 2.2.0'. Upgrading Kotlin to 2.2.x is not possible, since many React Native libraries still depend on 2.0.x.

Can someone tell what can be done in this case? Upgrading the library is a necessity to support Android's 16 KB requirement.

bhavberi avatar Sep 04 '25 03:09 bhavberi

Same issue here

Saif-Ur-Rehman19 avatar Sep 04 '25 14:09 Saif-Ur-Rehman19

+1

huybui21 avatar Sep 05 '25 08:09 huybui21

here a patch file with the latest changes from version 6.7.7 to commit b0b074f

react-native-pdf+6.7.7.patch

for now until we'll get an npm release 🙄

roidayan1 avatar Sep 10 '25 12:09 roidayan1

What is the release schedule of versions? If the patch is already available and it's only a upload. I am sure that you know about the current situation, that google play is forcing new apps to comply to the 16KB requirement and existing apps the following months. Would save the hassle of applying the patch manually

MarkHeijnekamp-Atermes avatar Sep 10 '25 12:09 MarkHeijnekamp-Atermes

I'm not the maintainer, I have the same issue as you so Iv'e created a patch and shared it. you don't have to manually install the patch, use patch-package.

roidayan1 avatar Sep 10 '25 12:09 roidayan1

here a patch file with the latest changes from version 6.7.7 to commit b0b074f

react-native-pdf+6.7.7.patch

for now until we'll get an npm release 🙄

Is there a way to come up with a fix that does not require kotlin 2.2.0? Cant make it work with react native 0.77

nes123 avatar Sep 11 '25 07:09 nes123

From what i am seeing implementation 'io.legere:pdfiumandroid:1.0.32' is enough, 1.0.33 is not needed for the 16KB..and 1.0.32 still depends on kotlin 2.0.21

nes123 avatar Sep 11 '25 09:09 nes123

@nes123 cool so just edit the patch file for your needs.

roidayan1 avatar Sep 11 '25 09:09 roidayan1

From what i am seeing implementation 'io.legere:pdfiumandroid:1.0.32' is enough, 1.0.33 is not needed for the 16KB..and 1.0.32 still depends on kotlin 2.0.21

The PDFiumandroid 1.0.33 does have a fix for some crashes see https://github.com/wonday/react-native-pdf/pull/957#issue-3304458049

MarkHeijnekamp-Atermes avatar Sep 11 '25 11:09 MarkHeijnekamp-Atermes

Same issue. Any update on this?

aroraprateek202112 avatar Sep 26 '25 13:09 aroraprateek202112

From what i am seeing implementation 'io.legere:pdfiumandroid:1.0.32' is enough, 1.0.33 is not needed for the 16KB..and 1.0.32 still depends on kotlin 2.0.21

The PDFiumandroid 1.0.33 does have a fix for some crashes see #957 (comment)

APK Analyzer gave warnings Root cause:

  1. Native libraries precompiled with 4 KB pages

PdfiumAndroid ships .so files (libmodpdfium.so, libmodpng.so, libmodft2.so, libjnipdfium.so).

These were built with 4 KB memory page alignment, but Android 15+ requires 16 KB compatibility.

  1. Dependency chain App → [email protected] → [email protected] → precompiled native libs

So the warnings show up because react-native-pdf depends on PdfiumAndroid, which hasn’t been rebuilt with 16 KB support yet.

Siddhantshelake avatar Sep 28 '25 06:09 Siddhantshelake

+1

viniciusnascimento95 avatar Sep 29 '25 19:09 viniciusnascimento95

Is this library still being maintained or do we need to start looking at forking / switching to another library?

gtaylor44 avatar Sep 30 '25 01:09 gtaylor44

Is this library still being maintained or do we need to start looking at forking / switching to another library?

I don't know bro, but it's been like this for a while

viniciusnascimento95 avatar Sep 30 '25 01:09 viniciusnascimento95

8 months since the latest release is quite long, isn't it?

joix97b avatar Oct 03 '25 17:10 joix97b