LeGoffMael / video_editor

A flutter package for editing video written in pure Dart with fully customizable UI. Supports crop, trim, rotation and cover selection.

Home Page:https://pub.dev/packages/video_editor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Library not loaded: '@rpath/libavcodec.framework/libavcodec

Toolenaar opened this issue · comments

I am having a problem when running this plugin on iOS. Everytime I run the app it crashes on startup with the following error.

This might have something todo with arthenica/ffmpeg-kit#590

But I am not able to solve this using the steps they describe.

 Library not loaded: '@rpath/libavcodec.framework/libavcodec'
  Referenced from: '/private/var/containers/Bundle/Application/C7643BCB-DC14-44D8-9183-331C54D815AC/Runner.app/Runner'
  Reason: tried: '/usr/lib/swift/libavcodec.framework/libavcodec' (no such file), '/usr/lib/swift/libavcodec.framework/libavcodec' (no such file), '/private/var/containers/Bundle/Application/C7643BCB-DC14-44D8-9183-331C54D815AC/Runner.app/Frameworks/libavcodec.framework/libavcodec' (no such file), '/private/var/containers/Bundle/Application/C7643BCB-DC14-44D8-9183-331C54D815AC/Runner.app/Frameworks/libavcodec.framework/libavcodec' (no such file), '/usr/lib/swift/libavcodec.framework/libavcodec' (no such file), '/private/var/containers/Bundle/Application/C7643BCB-DC14-44D8-9183-331C54D815AC/Runner.app/Frameworks/libavcodec.framework/libavcodec' (no such file), '/private/var/containers/Bundle/Application/C7643BCB-DC14-44D8-9183-331C54D815AC/Runner.app/Frameworks/libavcodec.framework/libavcodec' (no such file), '/private/var/containers/Bundle/Application/C7643BCB-DC14-44D8-9183-331C54D815AC/Runner.app/Frameworks/libavcodec.framework/libavcodec' (no such file), '/usr/lib/swift/libavcodec.framework/libavcodec' (no such file), '/usr/lib/swift/libavcodec.framework/libavcodec' (no such file), '/private/var/containers/Bundle/Application/C7643BCB-DC14-44D8-9183-331C54D815AC/Runner.app/Frameworks/libavcodec.framework/libavcodec' (no such file), '/private/var/containers/Bundle/Application/C7643BCB-DC14-44D8-9183-331C54D815AC/Runner.app/Frameworks/libavcodec.framework/libavcodec' (no such file), '/usr/lib/swift/libavcodec.framework/libavcodec' (no such file), '/private/var/containers/Bundle/Application/C7643BCB-DC14-44D8-9183-331C54D815AC/Runner.app/Frameworks/libavcodec.framework/libavcodec' (no such file), '/private/var/containers/Bundle/Application/C7643BCB-DC14-44D8-9183-331C54D815AC/Runner.app/Frameworks/libavcodec.framework/libavcodec' (no such file), '/private/var/containers/Bundle/Application/C7643BCB-DC14-44D8-9183-331C54D815AC/Runner.app/Frameworks/libavcodec.framework/libavcodec' (no such file), '/System/Library/Frameworks/libavcodec.framework/libavcodec' (no such file)
Library not loaded: '@rpath/libavcodec.framework/libavcodec'
  Referenced from: '/private/var/containers/Bundle/Application/C7643BCB-DC14-44D8-9183-331C54D815AC/Runner.app/Runner'
  Reason: tried: '/usr/lib/swift/libavcodec.framework/libavcodec' (no such file), '/usr/lib/swift/libavcodec.framework/libavcodec' (no such file), '/private/var/containers/Bundle/Application/C7643BCB-DC14-44D8-9183-331C54D815AC/Runner.app/Frameworks/libavcodec.framework/libavcodec' (no such file), '/private/var/containers/Bundle/Application/C7643BCB-DC14-44D8-9183-331C54D815AC/Runner.app/Frameworks/libavcodec.framework/libavcodec' (no such file), '/usr/lib/swift/libavcodec.framework/libavcodec' (no such file), '/private/var/containers/Bundle/Application/C7643BCB-DC14-44D8-9183-331C54D815AC/Runner.app/Frameworks/libavcodec.framework/libavcodec' (no such file), '/private/var/containers/Bundle/Application/C7643BCB-DC14-44D8-9183-331C54D815AC/Runner.app/Frameworks/libavcodec.framework/libavcodec' (no such file), '/private/var/container
commented

I also faced some issue when i switched to the latest ffmpeg release.
I described how i fixed this issue in the comment of the issue you linked : arthenica/ffmpeg-kit#590 (comment)

Don't you have an issue when running pod install ?

@LeGoffMael I tried your solution but it did not work for me, however I found that if I roll back to version 1.4.3 and use ffmpeg version 4.5.1 it worked. Not a fix but a workaround for now.

  video_editor: ^1.4.3
  
dependency_overrides:
  ffmpeg_kit_flutter_min_gpl: ^4.5.1-LTS
commented

Yes it seems this error occur only using the latest ffmpeg release (5.1.0) that video_editor is using since 1.5.0.
It seems that it is an cocoapods issue. I don't know what you can do, but check if you have the latest cocoapods and xcode version.

maybe overriding ffmpeg and using the latest video_editor version as a workaround is enough ?

dependency_overrides:
  ffmpeg_kit_flutter_min_gpl: ^4.5.1

I never managed to reproduce this issue. So, I'm not 100% sure about the reason and the fix.

However, a similar error is reported in CocoaPods/CocoaPods#11608, CocoaPods/CocoaPods#10390 and flutter/flutter#92896.

Those issues say that having an old ruby-macho package is the reason and upgrading ruby-macho fixes the issue.

Could anyone having this issue check the current version with gem list ruby-macho and see if updating it via sudo gem update ruby-macho fixes it?

I never managed to reproduce this issue. So, I'm not 100% sure about the reason and the fix.

However, a similar error is reported in CocoaPods/CocoaPods#11608, CocoaPods/CocoaPods#10390 and flutter/flutter#92896.

Those issues say that having an old ruby-macho package is the reason and upgrading ruby-macho fixes the issue.

Could anyone having this issue check the current version with gem list ruby-macho and see if updating it via sudo gem update ruby-macho fixes it?

update ruby-macho make me install two version ruby-macho.The problem not fix. but I uninstall all versions cocoapods and uninstall all versions ruby-macho and then install the lastest cocoapods. and then there is only one version ruby-macho. the problem fixed.Thank you.
image
image

commented

Thanks, solved a problem that has been bugging me for days

I never managed to reproduce this issue. So, I'm not 100% sure about the reason and the fix.
However, a similar error is reported in CocoaPods/CocoaPods#11608, CocoaPods/CocoaPods#10390 and flutter/flutter#92896.
Those issues say that having an old ruby-macho package is the reason and upgrading ruby-macho fixes the issue.
Could anyone having this issue check the current version with gem list ruby-macho and see if updating it via sudo gem update ruby-macho fixes it?

update ruby-macho make me install two version ruby-macho.The problem not fix. but I uninstall all versions cocoapods and uninstall all versions ruby-macho and then install the lastest cocoapods. and then there is only one version ruby-macho. the problem fixed.Thank you. image image

commented

Closed because since 3.0.0, FFmpeg is not part of this package