androidpdfium

What are the correct options to compile PDFium for Android?


I am trying to build PDFium for Android. I am using a Debian stretch.

I executed the following commands :

> mkdir build
> cd build
> mkdir build/source
> cd source
> gclient config --unmanaged https://pdfium.googlesource.com/pdfium.git
> echo "target_os = [ 'android' ]" >> .gclient
> gclient sync
> cd pdfium
> build/install-build-deps-android.sh

Once the dependencies were installed, I executed this :

> gn args wx/arm64/release

I put these as arguments

# Build arguments go here.
# See "gn args <out_dir> --list" for available build arguments.
target_os = "android"
target_cpu = "arm64"  # See "Figuring out target_cpu" below
use_goma = false  # Googlers only. Make sure goma is installed and running first. 
is_debug = false  # Enable debugging features.  
# Set true to enable experimental Skia backend. 
pdf_use_skia = false 
# # Set true to enable experimental Skia backend (paths only). 
pdf_use_skia_paths = false  
pdf_enable_xfa = false  # Set false to remove XFA support (implies JS support). 
pdf_enable_v8 = false  # Set false to remove Javascript support. 
pdf_is_standalone = true  # Set for a non-embedded build.  
is_component_build = true # Disable component build (Though it should work) # 
clang_use_chrome_plugins = false  # Currently must be false.
use_cxx11_on_android=false

When I exit the editor, i Get the following errors :

ERROR Unresolved dependencies.
//:pdfium_embeddertests__exec(//build/toolchain/android:android_clang_arm64)
  needs //build/android:cpplib_stripped(//build/toolchain/android:android_clang_arm64)
//:pdfium_unittests__exec(//build/toolchain/android:android_clang_arm64)
  needs //build/android:cpplib_stripped(//build/toolchain/android:android_clang_arm64)

Could you help me ? Do you have any ideas about the mistake I made here ? Is it a wrong configuration ? Missing dependency ?

Thank you very much for any help you could give me.


Solution

  • I answer to my own question in case somebody else gets the same problem. This was a problem in the Pdfium build scripts.

    This is now fixed in Pdfium/master (thanks to the Pdfium team !)

    Il you have an older version, you just have to remove these lines

    if (is_component_build || is_asan) {
      data_deps += [ "//build/android:cpplib_stripped" ]
    }
    

    in the file testing/test.gni