Open 842787863 opened 2 days ago
Note: this will pick the first one it finds, if you need a specific one we will need to configure this package to check first if there is ffmpeg files and if there is dont include ours,
build.gradle
file (android/app/build.gradle
).android
block in the packagingOptions
section:android {
...
packagingOptions {
pickFirst 'lib/arm64-v8a/libavcodec.so'
pickFirst 'lib/armeabi-v7a/libavcodec.so'
pickFirst 'lib/x86/libavcodec.so'
pickFirst 'lib/x86_64/libavcodec.so'
}
}
This configuration ensures that the build process picks one version of libavcodec.so
to avoid the conflict without affecting other libraries.
Thanks for the solution from @abdelaziz-mahdy
If you do not use videoio module to read and save videos, replace opencv_dart with opencv_core.
But it you need it, I have no better solutions than @abdelaziz-mahdy provided, we cant control the version of ffmpeg used by ffmpeg-kit.
Maybe the most compatible solution is keeping the same version as ffmpeg-kit when compiling opencv, and make opencv_dart depend on ffmpeg-kit, but ffmpeg-kit doesn't support windows and linux...
Thanks for the solution from @abdelaziz-mahdy
If you do not use videoio module to read and save videos, replace opencv_dart with opencv_core.
But it you need it, I have no better solutions than @abdelaziz-mahdy provided, we cant control the version of ffmpeg used by ffmpeg-kit.
Maybe the most compatible solution is keeping the same version as ffmpeg-kit when compiling opencv, and make opencv_dart depend on ffmpeg-kit, but ffmpeg-kit doesn't support windows and linux...
Thank you very much, the issue has been resolved. By the way, it's an amazing library!
Note: this will pick the first one it finds, if you need a specific one we will need to configure this package to check first if there is ffmpeg files and if there is dont include ours,
- Open your app-level file ().
build.gradle``android/app/build.gradle
- Add the following under the block in the section:
android``packagingOptions
android { ... packagingOptions { pickFirst 'lib/arm64-v8a/libavcodec.so' pickFirst 'lib/armeabi-v7a/libavcodec.so' pickFirst 'lib/x86/libavcodec.so' pickFirst 'lib/x86_64/libavcodec.so' } }
- Sync the Gradle project and rebuild.
This configuration ensures that the build process picks one version of to avoid the conflict without affecting other libraries.
libavcodec.so
Thank you, using pickFirst
can temporarily resolve the issue, but it may cause other dependency problems.
@842787863 Thanks~ may i ask that how did you solve it, use opencv_core or some thing else? which can help others with same issue.
@rainyl Thank you again. I choose to use opencv_core, although it lacks IO capabilities, I can compensate with the Android and iOS system APIs.
aha, you are welcome. I will leave the issue open to remind myself, have fun with opencv~
The following error occurs when ffmpeg_kit_flutter_full and opencv_dart exist: Execution failed for task ':app:mergeDebugNativeLibs'.