arthenica / ffmpeg-kit

FFmpeg Kit for applications. Supports Android, Flutter, iOS, Linux, macOS, React Native and tvOS. Supersedes MobileFFmpeg, flutter_ffmpeg and react-native-ffmpeg.
https://arthenica.github.io/ffmpeg-kit
GNU Lesser General Public License v3.0
4.48k stars 596 forks source link

not running on iOS in Flutter app(errno=2, not in dyld cache) #609

Closed singh-karan-7 closed 2 years ago

singh-karan-7 commented 2 years ago

I am trying to implement ffmpeg-kit framework in Flutter app. I added the framework to the project as described here. The app works on Android devices, but, app doesn't even start on iOS devices(neither real nor simulator). I am getting the following "Problem report for Runner" error dialog:

-------------------------------------
Translated Report (Full Report Below)
-------------------------------------

Incident Identifier: CCFC075E-32A1-41B4-92BD-7E0FDD667C5B
CrashReporter Key:   F60E85B5-7A7A-4A79-BC0D-1BE5AF1EE397
Hardware Model:      MacBookPro15,1
Process:             Runner [8799]
Path:                /Users/USER/Library/Developer/CoreSimulator/Devices/DBB8205F-647E-4895-849B-B128AB43DB82/data/Containers/Bundle/Application/076DAA2B-7087-48C2-9BED-07BBD98CC5EB/Runner.app/Runner
Identifier:          com.fresh.audios
Version:             1.0.0 (1)
Code Type:           X86-64 (Native)
Role:                Foreground
Parent Process:      launchd_sim [1114]
Coalition:           com.apple.CoreSimulator.SimDevice.DBB8205F-647E-4895-849B-B128AB43DB82 [901]
Responsible Process: SimulatorTrampoline [1060]

Date/Time:           2022-10-29 11:55:04.4881 +0530
Launch Time:         2022-10-29 11:55:04.3689 +0530
OS Version:          macOS 12.6 (21G115)
Release Type:        User
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: DYLD 1 Library missing
Library not loaded: @rpath/ffmpegkit.framework/ffmpegkit
Referenced from: <41C1626A-B46C-3B93-B49D-186A432CAB32> /Users/USER/Library/Developer/CoreSimulator/Devices/DBB8205F-647E-4895-849B-B128AB43DB82/data/Containers/Bundle/Application/076DAA2B-7087-48C2-9BED-07BBD98CC5EB/Runner.app/Runner
Reason: tried: '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/ffmpegkit.framework/ffmpegkit' (errno=2), '/usr/lib/swift/ffmpegkit.framework/ffmpegkit' (errno=2, not in dyld cache), '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/ffmpegkit.framework/ffmpegkit' (errno=2), '/usr/lib/swift/ffmpegkit.framework/ffmpegkit' (errno=2, not in dyld cache), '/Users/karanveersinghbrar/Library/Developer/CoreSimulator/Devices/DBB8205F-647E-4895-849B-B128A
(terminated at launch; ignore backtrace)

Triggered by Thread:  0

Thread 0 Crashed:
0   dyld                                   0x1137bd98e __abort_with_payload + 10
1   dyld                                   0x1137d3a72 abort_with_payload_wrapper_internal + 80
2   dyld                                   0x1137d3aa4 abort_with_payload + 9
3   dyld_sim                               0x10629a593 abort_with_payload + 26
4   dyld_sim                               0x106247f1e dyld4::halt(char const*) + 375
5   dyld_sim                               0x106245f75 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 3928
6   dyld_sim                               0x1062461a0 _dyld_sim_prepare + 442
7   dyld                                   0x11377db78 dyld4::prepareSim(dyld4::RuntimeState&, char const*) + 1265
8   dyld                                   0x11377c70e dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 244
9   dyld                                   0x11377c4e4 start + 388

Thread 0 crashed with X86 Thread State (64-bit):
  rax: 0x0000000002000209  rbx: 0x0000000000000000  rcx: 0x00007ff7b9fc40e8  rdx: 0x00007ff7b9fc4560
  rdi: 0x0000000000000006  rsi: 0x0000000000000001  rbp: 0x00007ff7b9fc4130  rsp: 0x00007ff7b9fc40e8
   r8: 0x00007ff7b9fc4160   r9: 0x0000000000000000  r10: 0x00000000000000fa  r11: 0x0000000000000246
  r12: 0x00000000000000fa  r13: 0x00007ff7b9fc4560  r14: 0x0000000000000001  r15: 0x0000000000000006
  rip: 0x00000001137bd98e  rfl: 0x0000000000000246  cr2: 0x000000010624c470

Logical CPU:     0
Error Code:      0x02000209 
Trap Number:     133

Binary Images:
       0x113777000 -        0x1137e2fff dyld (*) <71febccd-d9dc-3599-9971-2b3407c588a8> /usr/lib/dyld
       0x106244000 -        0x1062a3fff dyld_sim (*) <db2ea9eb-03d5-3b81-a6ce-26ec4dd81b07> /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/dyld_sim

EOF

-----------
Full Report
-----------

{"app_name":"Runner","timestamp":"2022-10-29 11:55:04.00 +0530","app_version":"1.0.0","slice_uuid":"41c1626a-b46c-3b93-b49d-186a432cab32","build_version":"1","platform":7,"bundleID":"com.flutterflow.dave","share_with_app_devs":1,"is_first_party":0,"bug_type":"309","os_version":"macOS 12.6 (21G115)","incident_id":"CCFC075E-32A1-41B4-92BD-7E0FDD667C5B","name":"Runner"}
{
  "uptime" : 1300,
  "procLaunch" : "2022-10-29 11:55:04.3689 +0530",
  "procRole" : "Foreground",
  "version" : 2,
  "userID" : 501,
  "deployVersion" : 210,
  "modelCode" : "MacBookPro15,1",
  "procStartAbsTime" : 1325087128319,
  "coalitionID" : 901,
  "osVersion" : {
    "train" : "macOS 12.6",
    "build" : "21G115",
    "releaseType" : "User"
  },
  "captureTime" : "2022-10-29 11:55:04.4881 +0530",
  "incident" : "CCFC075E-32A1-41B4-92BD-7E0FDD667C5B",
  "bug_type" : "309",
  "pid" : 8799,
  "procExitAbsTime" : 1325205482042,
  "cpuType" : "X86-64",
  "procName" : "Runner",
  "procPath" : "\/Users\/USER\/Library\/Developer\/CoreSimulator\/Devices\/DBB8205F-647E-4895-849B-B128AB43DB82\/data\/Containers\/Bundle\/Application\/076DAA2B-7087-48C2-9BED-07BBD98CC5EB\/Runner.app\/Runner",
  "bundleInfo" : {"CFBundleShortVersionString":"1.0.0","CFBundleVersion":"1","CFBundleIdentifier":"com.flutterflow.dave"},
  "storeInfo" : {"deviceIdentifierForVendor":"883D32A1-197A-5D16-B594-09420B8AC4EF","thirdParty":true},
  "parentProc" : "launchd_sim",
  "parentPid" : 1114,
  "coalitionName" : "com.apple.CoreSimulator.SimDevice.DBB8205F-647E-4895-849B-B128AB43DB82",
  "crashReporterKey" : "F60E85B5-7A7A-4A79-BC0D-1BE5AF1EE397",
  "responsiblePid" : 1060,
  "responsibleProc" : "SimulatorTrampoline",
  "bridgeVersion" : {"build":"19P6067","train":"6.6"},
  "sip" : "enabled",
  "isCorpse" : 1,
  "exception" : {"codes":"0x0000000000000000, 0x0000000000000000","rawCodes":[0,0],"type":"EXC_CRASH","signal":"SIGABRT"},
  "termination" : {"code":1,"flags":518,"namespace":"DYLD","indicator":"Library missing","details":["(terminated at launch; ignore backtrace)"],"reasons":["Library not loaded: @rpath\/ffmpegkit.framework\/ffmpegkit","Referenced from: <41C1626A-B46C-3B93-B49D-186A432CAB32> \/Users\/USER\/Library\/Developer\/CoreSimulator\/Devices\/DBB8205F-647E-4895-849B-B128AB43DB82\/data\/Containers\/Bundle\/Application\/076DAA2B-7087-48C2-9BED-07BBD98CC5EB\/Runner.app\/Runner","Reason: tried: '\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot\/usr\/lib\/swift\/ffmpegkit.framework\/ffmpegkit' (errno=2), '\/usr\/lib\/swift\/ffmpegkit.framework\/ffmpegkit' (errno=2, not in dyld cache), '\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot\/usr\/lib\/swift\/ffmpegkit.framework\/ffmpegkit' (errno=2), '\/usr\/lib\/swift\/ffmpegkit.framework\/ffmpegkit' (errno=2, not in dyld cache), '\/Users\/karanveersinghbrar\/Library\/Developer\/CoreSimulator\/Devices\/DBB8205F-647E-4895-849B-B128A"]},
  "extMods" : {"caller":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"system":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"targeted":{"thread_create":0,"thread_set_state":0,"task_for_pid":0},"warnings":0},
  "faultingThread" : 0,
  "threads" : [{"triggered":true,"id":60532,"threadState":{"r13":{"value":140701953967456},"rax":{"value":33554953},"rflags":{"value":582},"cpu":{"value":0},"r14":{"value":1},"rsi":{"value":1},"r8":{"value":140701953966432},"cr2":{"value":4398040176},"rdx":{"value":140701953967456},"r10":{"value":250},"r9":{"value":0},"r15":{"value":6},"rbx":{"value":0},"trap":{"value":133},"err":{"value":33554953},"r11":{"value":582},"rip":{"value":4621851022,"matchesCrashFrame":1},"rbp":{"value":140701953966384},"rsp":{"value":140701953966312},"r12":{"value":250},"rcx":{"value":140701953966312},"flavor":"x86_THREAD_STATE","rdi":{"value":6}},"frames":[{"imageOffset":289166,"symbol":"__abort_with_payload","symbolLocation":10,"imageIndex":0},{"imageOffset":379506,"symbol":"abort_with_payload_wrapper_internal","symbolLocation":80,"imageIndex":0},{"imageOffset":379556,"symbol":"abort_with_payload","symbolLocation":9,"imageIndex":0},{"imageOffset":353683,"symbol":"abort_with_payload","symbolLocation":26,"imageIndex":1},{"imageOffset":16158,"symbol":"dyld4::halt(char const*)","symbolLocation":375,"imageIndex":1},{"imageOffset":8053,"symbol":"dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)","symbolLocation":3928,"imageIndex":1},{"imageOffset":8608,"symbol":"_dyld_sim_prepare","symbolLocation":442,"imageIndex":1},{"imageOffset":27512,"symbol":"dyld4::prepareSim(dyld4::RuntimeState&, char const*)","symbolLocation":1265,"imageIndex":0},{"imageOffset":22286,"symbol":"dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*)","symbolLocation":244,"imageIndex":0},{"imageOffset":21732,"symbol":"start","symbolLocation":388,"imageIndex":0}]}],
  "usedImages" : [
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4621561856,
    "size" : 442368,
    "uuid" : "71febccd-d9dc-3599-9971-2b3407c588a8",
    "path" : "\/usr\/lib\/dyld",
    "name" : "dyld"
  },
  {
    "source" : "P",
    "arch" : "x86_64",
    "base" : 4398006272,
    "size" : 393216,
    "uuid" : "db2ea9eb-03d5-3b81-a6ce-26ec4dd81b07",
    "path" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime\/Contents\/Resources\/RuntimeRoot\/usr\/lib\/dyld_sim",
    "name" : "dyld_sim"
  }
],
  "sharedCache" : {
  "base" : 140703128616960,
  "size" : 2997714944,
  "uuid" : "3c81cd09-7075-355d-83a4-a03763701610"
},
  "vmSummary" : "ReadOnly portion of Libraries: Total=402.7M resident=0K(0%) swapped_out_or_unallocated=402.7M(100%)\nWritable regions: Total=9500K written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=9500K(100%)\n\n                                VIRTUAL   REGION \nREGION TYPE                        SIZE    COUNT (non-coalesced) \n===========                     =======  ======= \nSTACK GUARD                       56.0M        1 \nStack                             8192K        1 \nVM_ALLOCATE                         12K        3 \n__DATA                            1985K       53 \n__DATA_CONST                      4636K       52 \n__DATA_DIRTY                         4K        2 \n__FONT_DATA                          4K        1 \n__LINKEDIT                       343.4M       38 \n__TEXT                            59.3M       52 \ndyld private memory               1280K        2 \n===========                     =======  ======= \nTOTAL                            474.4M      205 \n",
  "legacyInfo" : {
  "threadTriggered" : {

  }
},
  "trialInfo" : {
  "rollouts" : [
    {
      "rolloutId" : "5fb4245a1bbfe8005e33a1e1",
      "factorPackIds" : {

      },
      "deploymentId" : 240000015
    },
    {
      "rolloutId" : "60186475825c62000ccf5450",
      "factorPackIds" : {

      },
      "deploymentId" : 240000026
    }
  ],
  "experiments" : [

  ]
}
}

Model: MacBookPro15,1, BootROM 1731.140.2.0.0 (iBridge: 19.16.16067.0.0,0), 6 processors, 6-Core Intel Core i7, 2.2 GHz, 16 GB, SMC 
Graphics: Intel UHD Graphics 630, Intel UHD Graphics 630, Built-In
Display: Color LCD, 2880 x 1800 Retina, Main, MirrorOff, Online
Graphics: Radeon Pro 560X, Radeon Pro 560X, PCIe, 4 GB
Memory Module: BANK 0/ChannelA-DIMM0, 8 GB, DDR4, 2400 MHz, Micron, 8ATF1G64HZ-2G6E1
Memory Module: BANK 2/ChannelB-DIMM0, 8 GB, DDR4, 2400 MHz, Micron, 8ATF1G64HZ-2G6E1
AirPort: spairport_wireless_card_type_wifi (0x14E4, 0x7BF), wl0: Jul 12 2021 19:26:30 version 9.30.464.0.32.5.76 FWID 01-45ccefcd
Bluetooth: Version (null), 0 services, 0 devices, 0 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
USB Device: USB31Bus
USB Device: T2Bus
USB Device: Touch Bar Backlight
USB Device: Touch Bar Display
USB Device: Apple Internal Keyboard / Trackpad
USB Device: Headset
USB Device: Ambient Light Sensor
USB Device: FaceTime HD Camera (Built-in)
USB Device: Apple T2 Controller
Thunderbolt Bus: MacBook Pro, Apple Inc., 47.5
Thunderbolt Bus: MacBook Pro, Apple Inc., 47.5
ghost commented 2 years ago

Did you find any solution for this ? I have same problem.

(lldb) dyld[82371]: Library not loaded: '@rpath/ffmpegkit.framework/ffmpegkit' Referenced from: '/private/var/containers/Bundle/Application/64E91E86-F4D4-4343-AD71-048C102962A8/Runner.app/Runner' Reason: tried: '/usr/lib/swift/ffmpegkit.framework/ffmpegkit' (no such file), '/usr/lib/swift/ffmpegkit.framework/ffmpegkit' (no such file), '/private/var/containers/Bundle/Application/64E91E86-F4D4-4343-AD71-048C102962A8/Runner.app/Frameworks/ffmpegkit.framework/ffmpegkit' (no such file), '/private/var/containers/Bundle/Application/64E91E86-F4D4-4343-AD71-048C102962A8/Runner.app/Frameworks/ffmpegkit.framework/ffmpegkit' (no such file), '/private/var/containers/Bundle/Application/64E91E86-F4D4-4343-AD71-048C102962A8/Runner.app/Frameworks/ffmpegkit.framework/ffmpegkit' (no such file), '/usr/lib/swift/ffmpegkit.framework/ffmpegkit' (no such file), '/usr/lib/swift/ffmpegkit.framework/ffmpegkit' (no such file), '/private/var/containers/Bundle/Application/64E91E86-F4D4-4343-AD71-048C102962A8/Runner.app/Frameworks/ffmpegkit.framework/ffmpegkit' (no such file), '/private/var/containers/Bundle/Application/64E91E86-F4D4-4343-AD71-048C102962A8/Runner.app/Frameworks/ffmpegkit.framework/ffmpegkit' (no such file), '/private/var/containers/Bundle/Application/64E91E86-F4D4-4343-AD71-048C102962A8/Runner.app/Frameworks/ffmpegkit.framework/ffmpegkit' (no such file), '/System/Library/Frameworks/ffmpegkit.framework/ffmpegkit' (no such file)

singh-karan-7 commented 2 years ago

Yes, in my case, I did not add dependency in pubspec.yaml file. This is how you should add:

ffmpeg_kit_flutter: 5.1.0-LTS

The important point to note is to NOT add the ^ symbol at the start of the version.

ghost commented 2 years ago

But I'm using video trimmer and in that it is used. I never used directly it in my project still getting same error

RajLogistic commented 1 year ago

i added this package ffmpeg_kit_flutter_min_gpl: ^5.1.0 and i am getting platfrom exception error in iOS but works fine in android. can anyone have idea about this?

singh-karan-7 commented 1 year ago

i added this package ffmpeg_kit_flutter_min_gpl: ^5.1.0 and i am getting platfrom exception error in iOS but works fine in android. can anyone have idea about this?

Did you try removing the caret symbol(^)?Try: ffmpeg_kit_flutter_min_gpl: 5.1.0

or try the one that I have written above: ffmpeg_kit_flutter: 5.1.0-LTS

singh-karan-7 commented 1 year ago

But I'm using video trimmer and in that it is used. I never used directly it in my project still getting same error

Please, do tell the exact library(with link) or just try the ffmpeg_kit_flutter directly.