gpt4 book ai didi

java - 从输入中找到路径为 'lib/arm64-v8a/libc++_shared.so' 的 2 个文件...-react native

转载 作者:行者123 更新时间:2023-12-04 22:45:01 25 4
gpt4 key购买 nike

我正在尝试启用 ffmpeg-kit-react-native 的包在 native react 。
example 中给出的示例命令成功执行。但我想用 libwebp用于将 gif 文件转换为 package 下的 webp命名为 video .如instrcuted .我必须启用 package使用一些库。

2.2.1 Enabling a Package on AndroidEdit android/build.gradle file and add the package name in ext.ffmpegKitPackage variable.

ext {
ffmpegKitPackage = "<package name>"
}

所以我在 node_module/ffmpeg-kit-react-native/android/build.gradle 中添加了一行
android {
compileSdkVersion 30

defaultConfig {
minSdkVersion safeExtGet('ffmpegKitPackage', 'https').contains("-lts") ? 16 : 24
targetSdkVersion 30
versionCode 451
versionName "4.5.1"
}

buildTypes {
release {
minifyEnabled false
}
}
lintOptions {
disable 'GradleCompatible'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

rootProject.ext.ffmpegKitPackage = "video" // Added this line here

}
错误:
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
> 2 files found with path 'lib/arm64-v8a/libc++_shared.so' from inputs:
- C:\Users\ADMIN\.gradle\caches\transforms-3\7403ebe5571a2ce5a6a5fc9876af4814\transformed\jetified-react-native-0.66.4\jni
- C:\Users\ADMIN\.gradle\caches\transforms-3\4be54e44fe38656741a8345504588323\transformed\jetified-ffmpeg-kit-video-4.5.1-1\jni
If you are using jniLibs and CMake IMPORTED targets, see
https://developer.android.com/r/tools/jniLibs-vs-imported-targets
我已经尝试过 ./gradlew clean 但问题仍然存在。
如何修复此错误?谢谢

最佳答案

将此添加到您的 node_module/ffmpeg-kit-react-native/android/build.gradle

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'
}
rootProject.ext.ffmpegKitPackage = "video"
}
ffmpeg-kit-react-native 已经在这里讨论过这个错误。 https://github.com/tanersener/ffmpeg-kit/wiki/Tips#2-depending-another-android-library-containing-libc_sharedso

关于java - 从输入中找到路径为 'lib/arm64-v8a/libc++_shared.so' 的 2 个文件...-react native,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70890854/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com