Execution failed for task ':app:mergeReleaseNativeLibs'

  • Whenever you get an app building error as “Task :app:mergeReleaseNativeLibs FAILED”.
  • It must look like this,
  • Carefully observe which files are giving errors.
  • In this case, libc++_shared.so and libfbjni.so are giving the errors.
  • so to solve the issue, one needs to add packagingOptions in app-level build.gradle.
  • and it will be like,
  •  

  • Remember, add only those files which are responsible for the error.
  • Happy coding!
Updated on Mar 27, 2023