espresso3389 / pdfrx

pdfrx is yet another PDF viewer implementation that built on the top of pdfium. The plugin currently supports Android, iOS, Windows, macOS, Linux, and Web.
MIT License
60 stars 36 forks source link

Execution failed for task ':pdfrx:mergeDebugNativeLibs' #133

Closed reddeath1 closed 4 weeks ago

reddeath1 commented 4 weeks ago
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':pdfrx:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction
   > 2 files found with path 'lib/arm64-v8a/libpdfium.so' from inputs:
      - /Volumes/xxx/build/pdfrx/intermediates/merged_jni_libs/debug/out/arm64-v8a/libpdfium.so
      - /Volumes/xxxx/build/pdfrx/intermediates/cxx/Debug/6yz3xf71/obj/arm64-v8a/libpdfium.so
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

This happens only when building for android devices

espresso3389 commented 4 weeks ago

Duplicate of #8 and #82; search mergeReleaseNativeLibs instead of mergeDebugNativeLibs.

Add the following to android/build.gradle:

packagingOptions {
  pickFirst '**/libpdfium.so'
}

https://github.com/espresso3389/pdfrx/issues/8#issuecomment-1898225027