Closed varahash closed 1 month ago
Hi @varahash,
Thank you for this contribution.
I don't plan on maintaining products beyond their end-of-life period, but I'm happy to change the target version if that is all we need. Please confirm that you tested the resulting build on old and recent versions of Android.
About the name change, it is a completely different issue and needs to be discussed elsewhere. Please create a dedicated PR for the rename.
Best regards, Benoit
Hi @bblanchon, thank you for reviewing this!
Yes, I can confirm this fix works for all Android versions, starting from Android 5 (API 21) to the latest one Android 14 (API 34).
I don't plan on maintaining products beyond their end-of-life period
The major libraries from Google still support API 21 level, it would awesome if could to do same (it actually does not require any hard work, just couple configuration changes)
About the name change, it is a completely different issue and needs to be discussed elsewhere
This change is essential to make it work on Android 5.x (API 21-22) (see details in PR description).
Or if you really against supporting of API 21-22 out-of-box, then maybe we can add option to build.sh
, so that user can at least easily change library name if needed.
To make it work on Android 21+, we need following changes:
1) Change
default_min_sdk_version
, by default pdfium uses 26 for this variable, but we can set it to 21. This is actually lowest supported sdk version by pdfuim controlled bymin_supported_sdk_version
(see pdfium/build/config/android/config.gni:90)2) Change library
soname
to avoid conflict with system pdfium library. Due to the linker bug on older Android API levels (which was fixed in API 23+ Correct soname/path handling (Available in API level >= 23) System linker prefers already loaded/system/lib/libpdfium.so
library instead of our library when making symbol resolution. That why you can receive such errors https://github.com/bblanchon/pdfium-binaries/issues/147#issuecomment-1837542975Fixes #147