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

Update build.gradle #127

Closed delogrefin closed 1 month ago

delogrefin commented 1 month ago

During the build of the apk file of my app, I always get this issue from pdfrx. Specifying this packaging option on the main project level does not solve the issue.

Execution failed for task ':pdfrx:mergeReleaseNativeLibs'.

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:

  • /jenkins/workspace/head_amos_mobile_exec/amos_mobile_exec/build/pdfrx/intermediates/merged_jni_libs/release/out/arm64-v8a/libpdfium.so
  • /jenkins/workspace/head_amos_mobile_exec/amos_mobile_exec/build/pdfrx/intermediates/cxx/RelWithDebInfo/6i5b2q3w/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
espresso3389 commented 1 month ago

Yes, I knew the issue. This is not the first time someone suggests the change (like #8).

But it comes from the duplication of libpdfium.so with other plugins or such. So basically I think it's an app issue and we should write it on app's build.gradle.

Am I wrong?

delogrefin commented 1 month ago

After checking this issue a bit deeper, you were right.

Although put the packaging option at the app level was not solving the issue, upgrading the com.android.application plugin in android build.gradle of my app finally solves the issue.

I updated to 7.4.2 as it was mentioned in a comment of #8 and it works :)

Thanks for your support and quick reply!