Skip to content

Android conflict when using react-native-audio-api with ffmpeg-kitΒ #866

@RemyNtshaykolo

Description

@RemyNtshaykolo

πŸ› Android conflict when using react-native-audio-api with ffmpeg-kit

Context

Following up on
πŸ‘‰ #808

The PR
πŸ‘‰ #813

successfully fixed the issue on iOS πŸŽ‰
However, on Android, a native library conflict still persists when using react-native-audio-api together with ffmpeg-kit.


❌ Problem

When building the Android app, Gradle fails during native libs merging with the following error:

* What went wrong:
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/libavcodec.so' from inputs:
      - /Users/remyntshaykolo/Documents/source/react-native-audio-api-ffmpeg/node_modules/react-native-audio-api/android/build/intermediates/library_jni/debug/copyDebugJniLibsProjectOnly/jni/arm64-v8a/libavcodec.so
      - /Users/remyntshaykolo/.gradle/caches/8.13/transforms/2b4f78b57abc536aa54f407c6028b979/transformed/ffmpeg-kit-full-gpl/jni/arm64-v8a/libavcodec.so
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

This indicates a duplicate native library (libavcodec.so) coming from:

  • react-native-audio-api
  • ffmpeg-kit-full-gpl

πŸ” Reproduction

A minimal reproduction repository is available here:
πŸ‘‰ https://github.com/RemyNtshaykolo/react-native-audo-api-ffmpeg

Steps to reproduce:

yarn pc   # Expo prebuild
yarn a-r  # Build & run on Android emulator

βœ… Expected behavior

  • react-native-audio-api should not bundle or expose conflicting FFmpeg native libraries on Android
    or

Thanks a lot for the great work on this library πŸ™
Let me know if you want me to test a patch or a branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions