endigo / flutter_pdfview

PDF view for Flutter
https://pub.dev/packages/flutter_pdfview
MIT License
264 stars 218 forks source link

libc++_shared.so conflict #287

Open deboLing opened 1 month ago

deboLing commented 1 month ago

Execution failed for task ':app:mergeDebugNativeLibs'.

A failure occurred while executing com.android.build.gradle.internal.tasks.MergeNativeLibsTask$MergeNativeLibsTaskWorkAction 2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs:

  • C:\Users\zhouyi.gradle\caches\transforms-3\324d8a4e270f29d97b6229048d022aa3\transformed\jetified-ffmpeg-kit-full-gpl-6.0-2\jni\arm64-v8a\libc++_shared.so
  • C:\Users\zhouyi.gradle\caches\transforms-3\e5ebbbde1d6dc67769a08ea07b4a883c\transformed\jetified-pdfium-android-1.9.2\jni\arm64-v8a\libc++_shared.so If you are using jniLibs and CMake IMPORTED targets, see https://developer.android.com/r/tools/jniLibs-vs-imported-targets
myhoaicv commented 1 month ago

I have the same error. Is there any other solution?

Bejkerr commented 1 month ago

I was able to resolve it by adding this under android{} block in app/build.gradle:

       packagingOptions {
        jniLibs.pickFirsts.add("**/libc++_shared.so")
    }

And this to AndroidMainfest.xml:

   <application
        android:extractNativeLibs="true">