Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'

*** First throw call stack:

(

0   CoreFoundation                      0x000000010dc768ab __exceptionPreprocess + 242

1   libobjc.A.dylib                     0x000000010d3f8ba3 objc_exception_throw + 48

2   Foundation                          0x00000001104e53a7 -[NSURL(NSURL) initFileURLWithPath:isDirectory:] + 0

3   Foundation                          0x00000001104e5b4b +[NSURL(NSURL) fileURLWithPath:] + 33

4   video_player_avfoundation           0x000000010b605973 -[FLTVideoPlayer initWithAsset:frameUpdater:] + 179

5   video_player_avfoundation           0x000000010b609e6c -[FLTVideoPlayerPlugin create:error:] + 540

6   video_player_avfoundation           0x000000010b6102ad __FLTAVFoundationVideoPlayerApiSetup_block_invoke.204 + 157

7   Flutter                             0x000000011465d4b8 __48-[FlutterBasicMessageChannel setMessageHandler:]_block_invoke + 110

8   Flutter                             0x000000011409618a ___ZN7flutter25PlatformMessageHandlerIos21HandlePlatformMessageENSt3__110unique_ptrINS_15PlatformMessageENS1_14default_deleteIS3_EEEE_block_invoke + 86

9   libdispatch.dylib                   0x000000010e3cd7fb _dispatch_call_block_and_release + 12

10  libdispatch.dylib                   0x000000010e3cea3a _dispatch_client_callout + 8

11  libdispatch.dylib                   0x000000010e3de32c _dispatch_main_queue_drain + 1338

12  libdispatch.dylib                   0x000000010e3ddde4 _dispatch_main_queue_callback_4CF + 31

13  CoreFoundation                      0x000000010dbd5b1f __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 9

14  CoreFoundation                      0x000000010dbd0436 __CFRunLoopRun + 2482

15  CoreFoundation                      0x000000010dbcf6a7 CFRunLoopRunSpecific + 560

16  GraphicsServices                    0x000000011216d28a GSEventRunModal + 139

17  UIKitCore                           0x0000000135e31ad3 -[UIApplication _run] + 994

18  UIKitCore                           0x0000000135e369ef UIApplicationMain + 123

19  Runner                              0x00000001023d6eaf main + 63

20  dyld                                0x000000010abf42bf start_sim + 10

21  ???                                 0x000000020276e310 0x0 + 8631280400

)

libc++abi: terminating with uncaught exception of type NSException

Answered by DTS Engineer in 743163022

Terminating app due to uncaught exception

Is this an app that you’re developing?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

Terminating app due to uncaught exception

Is this an app that you’re developing?

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Yes. Building the app on flutter and has already published the Android version of it (app is live on Play Store). But can't seem to figure out what's going wrong with the iOS version

OK.

So your app is crashing due to a language exception. The backtrace looks like this:

0 CoreFoundation            … __exceptionPreprocess + 242
1 libobjc.A.dylib           … objc_exception_throw + 48
2 Foundation                … -[NSURL(NSURL) initFileURLWithPath:isDirectory:] + 0
3 Foundation                … +[NSURL(NSURL) fileURLWithPath:] + 33
4 video_player_avfoundation … -[FLTVideoPlayer initWithAsset:frameUpdater:] + 179
5 video_player_avfoundation … -[FLTVideoPlayerPlugin create:error:] + 540
6 video_player_avfoundation … __FLTAVFoundationVideoPlayerApiSetup_block_invoke.204 + 157
7 Flutter                   … __48-[FlutterBasicMessageChannel setMessageHandler:]_block_invoke + 110
8 Flutter                   … ___ZN7flutter25PlatformMessageHandlerIos21HandlePlatformMessageENSt3__110…
9 libdispatch.dylib         … _dispatch_call_block_and_release + 12

Frame 9 is the Dispatch calling your third-party runtime. Frames 8 and 7 are that runtime. I’m not sure about frames 6 through 4, but they look like some sort of plug-in that you’ve brought in to play video. In frame 4 that plug-in calls +[NSURL(NSURL) fileURLWithPath:] and passes in a nil path. This gets to frame 3 where Foundation throws the language exception.

You have to investigate where frame 4 is getting this path to find out why it’s nil.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSURL initFileURLWithPath:]: nil string parameter'
 
 
Q