4

I had built a flutter app with some of the dependencies (from flutter pub). While running that application, It failed with this exception. How to fix this issue?

What went wrong:

Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > More than one file was found with OS independent path 'lib/x86/libc++_shared.so'

Thanks in advance.

Sandeep Sharma
  • 639
  • 2
  • 9
  • 34
  • 1
    Does this answer your question? [Task :app:transformNativeLibsWithMergeJniLibsForDebug FAILED](https://stackoverflow.com/questions/57194244/task-apptransformnativelibswithmergejnilibsfordebug-failed) – pledez Sep 09 '20 at 00:25

2 Answers2

6
android {

packagingOptions {
    pickFirst 'lib/x86/libc++_shared.so'
    pickFirst 'lib/x86_64/libc++_shared.so'
    pickFirst 'lib/armeabi-v7a/libc++_shared.so'
    pickFirst 'lib/arm64-v8a/libc++_shared.so'
}

do this inside your app build.gradle

Abhijit Chakra
  • 3,201
  • 37
  • 66
-1

I hope I am not very late. I also encountered the same Problem. Please close the app if running in background then clear any issues if in your code (Your IDE must be showing) and finally run flutter clean and this should do the trick.

Hope this helps. Thanks

Vikas Chandra
  • 565
  • 1
  • 9
  • 22