react-native-vision-camera: 🐛 Error building: "2 files found with path 'lib/arm64-v8a/libfolly_runtime.so' from inputs"

What were you trying to do?

I was trying to build the app

Reproduceable Code

No response

What happened instead?

The build fails

Relevant log output

> Task :app:mergeDebugNativeLibs FAILED
Execution optimizations have been disabled for task ':app:mergeDebugNativeLibs' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/home/user/Área de Trabalho/docscan/android/app/build/intermediates/merged_jni_libs/debug/out'. Reason: Task ':app:mergeDebugNativeLibs' uses this output of task ':app:copyDebugReactNativeVectorIconFonts' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.3.3/userguide/validation_problems.html#implicit_dependency for more details about this problem.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.3.3/userguide/command_line_interface.html#sec:command_line_warnings

Execution optimizations have been disabled for 8 invalid unit(s) of work during this build to ensure correctness.
Please consult deprecation warnings for more details.
295 actionable tasks: 24 executed, 271 up-to-date

FAILURE: Build failed with an exception.

* 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/libfolly_runtime.so' from inputs:
      - /home/user/Área de Trabalho/docscan/node_modules/react-native-vision-camera/android/build/intermediates/library_jni/debug/jni/arm64-v8a/libfolly_runtime.so
      - /home/user/.gradle/caches/transforms-3/1eed3d8d6e8f118b544df7150c917187/transformed/jetified-react-native-0.69.1-debug/jni/arm64-v8a/libfolly_runtime.so
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* 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/libfolly_runtime.so' from inputs:
      - /home/user/Área de Trabalho/docscan/node_modules/react-native-vision-camera/android/build/intermediates/library_jni/debug/jni/arm64-v8a/libfolly_runtime.so
      - /home/user/.gradle/caches/transforms-3/1eed3d8d6e8f118b544df7150c917187/transformed/jetified-react-native-0.69.1-debug/jni/arm64-v8a/libfolly_runtime.so
     If you are using jniLibs and CMake IMPORTED targets, see
     https://developer.android.com/r/tools/jniLibs-vs-imported-targets

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m

    at makeError (/home/user/Área de Trabalho/docscan/node_modules/execa/index.js:174:9)
    at /home/user/Área de Trabalho/docscan/node_modules/execa/index.js:278:16
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async runOnAllDevices (/home/user/Área de Trabalho/docscan/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:109:5)
    at async Command.handleAction (/home/user/Área de Trabalho/docscan/node_modules/react-native/node_modules/@react-native-community/cli/build/index.js:192:9)
info Run CLI with --verbose flag for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Device

Samsung S20 FE (Android 12)

VisionCamera Version

2.13.5

Additional information

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 5
  • Comments: 22 (5 by maintainers)

Most upvoted comments

I also have this issue after installing the patch in #1118

sorry for stupid qeustion, I see here https://github.com/mrousavy/react-native-vision-camera/pull/1144 that it was merge. Can I find somewhere when and possibly in which version it will be released ??

Thank you

Could you teach me how to install library from github source?

Hi, of course! To install the library using GitHub I ran:

npm install https://github.com/mrousavy/react-native-vision-camera
npx react-native run-android

Thats what I did and it worked for me. I think is not needed to build from source manually.