Skip to content

Fix loading shared library on Android - #6

Merged
garbear merged 1 commit into
Piersfrom
fix-android
Oct 23, 2026
Merged

garbear merged 1 commit into
Piersfrom
fix-android

Conversation

@garbear

@garbear garbear commented Oct 23, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Fix vfs.pdf failing to load on Android due to unresolved GNU iconv symbols.

  • Explicitly link Iconv::Iconv when using static Poppler on Android.
  • Preserve existing pkg-config linker flags, including libandroid.
  • Leave other platforms and dependency recipes unchanged.

Motivation and context

On Android ARM64, Kodi fails to initialize vfs.pdf with:

dlopen failed: cannot locate symbol "libiconv_open"
referenced by "libvfs.pdf.so"

Poppler's generated pkg-config metadata omits its iconv dependency because it references ICONV_LIBRARIES instead of Iconv_LIBRARIES.

The missing static library leaves libiconv, libiconv_open, and libiconv_close unresolved at runtime.

This change explicitly links the missing dependency without altering the existing Poppler linker flags.

How has this been tested?

  • Android ARM64 and ARMv7 builds and packaging passed using NDK 28.2, targeting API 24.
  • Verified all GNU iconv symbols are resolved in both architectures.
  • Renderer tests passed on macOS and Android.
  • NVIDIA Shield (Kodi v22 RC1): Add-on loads successfully, PDF opens fullscreen, both pages render, and page navigation works.
  • git diff --check passed.

Types of change

  • Bug fix (non-breaking change which fixes an issue)
  • Improvement
  • New feature
  • Breaking change

Summary by CodeRabbit

  • Chores
    • Android builds using a static Poppler C++ library now link the required text-encoding support. This improves build compatibility for that configuration and helps ensure the application links successfully. The change affects build setup rather than adding or changing user-facing features. Other supported configurations are not described as changing in this update.

Poppler's pkg-config metadata omits iconv, leaving GNU iconv symbols
unresolved in libvfs.pdf.so. Add Iconv::Iconv for static Android builds
while preserving the existing pkg-config link flags.
@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2ea682a7-20b6-4329-8143-7efc96512f55
📥 Commits

Reviewing files that changed from the base of the PR and between feae56a and e6a182f.

📒 Files selected for processing: 1
  • cmake/FindPoppler.cmake

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The Poppler CMake module now adds Iconv as a dependency when an Android build uses a static Poppler C++ library.

Changes: Android Poppler Linking

Layer / File(s) Summary
Android static-library dependencies
cmake/FindPoppler.cmake
When Android uses a Poppler C++ library with the .a suffix, the module requires Iconv and appends Iconv::Iconv to POPPLER_LIBRARIES.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to e6a18

The Android Poppler linking change is mergeable with no identified blocking risk.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title identifies the Android loading issue addressed by the change. It is somewhat broad and may be technically imprecise because the fix adds iconv linkage for static Poppler, but it remains rela…
Docstring Coverage Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title identifies the Android loading issue addressed by the change. It is somewhat broad and may be technically imprecise because the fix adds iconv linkage for static Poppler, but it remains related to the main change.

Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.)

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@garbear

garbear commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator Author

Confirmed working on my Shield with a test PDF

kodi-vfs-metadata-before-2026-10-23

@garbear
garbear merged commit eec172f into Piers Oct 23, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant