Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

video_compress/SwiftVideoCompressPlugin.swift:194: Fatal error: Unexpectedly found nil while unwrapping an Optional value #109

Open
getpu opened this issue May 19, 2021 · 8 comments

Comments

@getpu
Copy link

getpu commented May 19, 2021

video_compress/SwiftVideoCompressPlugin.swift:194: Fatal error: Unexpectedly found nil while unwrapping an Optional value
Lost connection to device.

This the latest version bug under the ios 14.5

@mrcsilverfox
Copy link

mrcsilverfox commented Jun 7, 2021

I tried on an iPhone with iOS 14.2 and sometimes it works other times I get the above error with several video with same extension .mov.
Optional(Error Domain=AVFoundationErrorDomain Code=-11829 "Cannot Open" UserInfo={NSUnderlyingError=0x281321c20 {Error Domain=NSOSStatusErrorDomain Code=-12848 "(null)"}, NSLocalizedFailureReason=This media may be damaged., NSURL=file:///private/var/mobile/Containers/Data/Application/../tmp/.video/IMG_0589.MOV, NSLocalizedDescription=Cannot Open})

@rignaneseleo
Copy link

rignaneseleo commented Jun 8, 2021

Same type of error on iOS 14.5:

2021-06-08 12:00:41.620932+0200 Runner[2420:1742265] flutter: Input file /private/var/mobile/Containers/Data/Application/519B17C5-D79D-4133-8687-466D6B40B02C/tmp/.video/IMG_5495.MOV [size: 4597030] 2021-06-08 12:00:41.621406+0200 Runner[2420:1742265] flutter: verbose: Compressing MOV video... 2021-06-08 12:00:41.621950+0200 Runner[2420:1742265] flutter: VideoCompress: You can try to subscribe to the 2021-06-08 12:00:41.622242+0200 Runner[2420:1742265] flutter: compressProgress$ stream to know the compressing state. Fatal error: Unexpectedly found nil while unwrapping an Optional value: file video_compress/SwiftVideoCompressPlugin.swift, line 194 2021-06-08 12:00:41.652250+0200 Runner[2420:1742078] Fatal error: Unexpectedly found nil while unwrapping an Optional value: file video_compress/SwiftVideoCompressPlugin.swift, line 194

When it happens it freezes the screen.

@duonghainbs
Copy link

duonghainbs commented Jun 29, 2021

Does anyone know how to fix this error, I don't know the swift code so I'm stuck.
IOS 14.6 compress mov -> mp4

@yanivshaked
Copy link
Contributor

Any update on this issue, or suggested workaround?
@jonataslaw Your help here is highly appriciated

video_compress/SwiftVideoCompressPlugin.swift:194: Fatal error: Unexpectedly found nil while unwrapping an Optional value
video_compress/SwiftVideoCompressPlugin.swift:194: Fatal error: Unexpectedly found nil while unwrapping an Optional value
* thread #1, queue = 'com.apple.main-thread', stop reason = Fatal error: Unexpectedly found nil while unwrapping an Optional value
    frame #0: 0x00000001ad8bf060 libswiftCore.dylib`_swift_runtime_on_report
libswiftCore.dylib`_swift_runtime_on_report:
->  0x1ad8bf060 <+0>: ret    
libswiftCore.dylib`_swift_reportToDebugger:
    0x1ad8bf064 <+0>: b      0x1ad8bf060               ; _swift_runtime_on_report
libswiftCore.dylib`_swift_shouldReportFatalErrorsToDebugger:
    0x1ad8bf068 <+0>: adrp   x8, 324119
    0x1ad8bf06c <+4>: ldrb   w0, [x8, #0xa11]
Target 0: (Runner) stopped.
Lost connection to device.

@yanivshaked
Copy link
Contributor

This issue is solved by replacing AssetEntity.file with AssetEntity.originFile from the picker, before providing it to the video compressor.

@markmusic27
Copy link

Having the same issue here. Just a quick question, where are you changing AssetEntity.file? What picker are you referring to?

@nihkilft123
Copy link

Same error arrived when started compressing MP4 video in iOS XR Black phone.
stopping recording video_compress/SwiftVideoCompressPlugin.swift:203: Fatal error: Unexpectedly found nil while unwrapping an Optional value

And @yanivshaked can you tell us where can change that AssetEntity.file? in flutter library? or else where?

@adigujjar
Copy link

Same error

video_compress/SwiftVideoCompressPlugin.swift:203: Fatal error: Unexpectedly found nil while unwrapping an Optional value
video_compress/SwiftVideoCompressPlugin.swift:203: Fatal error: Unexpectedly found nil while unwrapping an Optional value

  • thread [Clarification] Android status #1, queue = 'com.apple.main-thread', stop reason = Fatal error: Unexpectedly found nil while unwrapping an Optional value
    frame #0: 0x00000001cb7e00f8 libswiftCore.dylib_swift_runtime_on_report libswiftCore.dylib:
    -> 0x1cb7e00f8 <+0>: ret
    libswiftCore.dylib: 0x1cb7e00fc <+0>: b 0x1cb7e00f8 ; _swift_runtime_on_report libswiftCore.dylib:
    0x1cb7e0100 <+0>: adrp x8, 366505
    0x1cb7e0104 <+4>: ldrb w0, [x8, #0xabc]
    Target 0: (Runner) stopped.
    Lost connection to device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants