expo / examples

Example projects that demonstrate how to use Expo APIs and integrate Expo with other popular tools
2.14k stars 852 forks source link

[with-firebase-storage-upload] Crash when uploading videos #343

Open xxdd13 opened 2 years ago

xxdd13 commented 2 years ago

Describe the bug Expo go crash when uploading videos, on both emulator and physical device, no error messages in node console. Standalone app also crashes. No issues with photos

To Reproduce Steps to reproduce the behavior:

  1. Change media type to video
  2. Select a video
  3. Expo crash

Expected behavior Able to upload both videos and photos

Screenshots

Screen Shot 2021-11-27 at 1 02 57 pm

https://user-images.githubusercontent.com/26791482/143529912-c516d1a0-c7d7-4273-8787-ba918a6f2e0a.mov

Desktop (please complete the following information):

Smartphone (please complete the following information):

Additional context Add any other context about the problem here.

Translated Report (Full Report Below)

Incident Identifier: 149D1A97-0931-4959-99D1-E7D55BD06C67 CrashReporter Key: 027547F0-F0A0-0284-9F93-DFF21C994CB5 Hardware Model: iMac19,1 Process: Expo Go [2409] Path: /Users/USER/Library/Developer/CoreSimulator/Devices/B7CEDF12-0EDC-462E-B621-A5C4F606D8FC/data/Containers/Bundle/Application/D93A18CA-DB05-4B0E-B314-725AFFE52FB4/Exponent-2.22.4.tar.app/Expo Go Identifier: host.exp.Exponent Version: 2.22.4 (2.22.4.101) Code Type: X86-64 (Native) Role: Foreground Parent Process: launchd_sim [2235] Coalition: com.apple.CoreSimulator.SimDevice.B7CEDF12-0EDC-462E-B621-A5C4F606D8FC [1589] Responsible Process: SimulatorTrampoline [2221]

Date/Time: 2021-11-27 13:00:12.2718 +1100 Launch Time: 2021-11-27 12:58:01.4344 +1100 OS Version: macOS 12.0.1 (21A559) Release Type: User Report Version: 104

Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Exception Note: EXC_CORPSE_NOTIFY Triggered by Thread: 12

Application Specific Information: dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot CoreSimulator 776.4 - Device: iPhone 13 (B7CEDF12-0EDC-462E-B621-A5C4F606D8FC) - Runtime: iOS 15.0 (19A339) - DeviceType: iPhone 13 terminating with uncaught exception of type NSException Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]' dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot abort() called

Last Exception Backtrace: 0 CoreFoundation 0x11aec1ba4 exceptionPreprocess + 226 1 libobjc.A.dylib 0x110560be7 objc_exception_throw + 48 2 CoreFoundation 0x11af41f38 _CFThrowFormattedException + 194 3 CoreFoundation 0x11af4c42e -[NSPlaceholderDictionary initWithCapacity:].cold.1 + 0 4 CoreFoundation 0x11af2f914 -[NSPlaceholderDictionary initWithObjects:forKeys:count:] + 251 5 CoreFoundation 0x11aec083b +[NSDictionary dictionaryWithObjects:forKeys:count:] + 49 6 Expo Go 0x108ab0894 -[ABI43_0_0RCTBlobManager handleNetworkingRequest:] + 386 7 Expo Go 0x108ac8040 -[ABI43_0_0RCTNetworking processDataForHTTPQuery:callback:] + 325 8 Expo Go 0x108ac78bb -[ABI43_0_0RCTNetworking buildRequest:completionBlock:] + 1189 9 Expo Go 0x108acab8d -[ABI43_0_0RCTNetworking sendRequest:callback:] + 944 10 CoreFoundation 0x11aec847c _invoking + 140 11 CoreFoundation 0x11aec5872 -[NSInvocation invoke] + 305 12 CoreFoundation 0x11aec5b05 -[NSInvocation invokeWithTarget:] + 70 13 Expo Go 0x108a30fce -[ABI43_0_0RCTModuleMethod invokeWithBridge:module:arguments:] + 595 14 Expo Go 0x108a33844 ABI43_0_0facebook::ABI43_0_0React::invokeInner(ABI43_0_0RCTBridge, ABI43_0_0RCTModuleData, unsigned int, folly::dynamic const&, int, (anonymous namespace)::SchedulingContext) + 574 15 Expo Go 0x108a33479 invocation function for block in ABI43_0_0facebook::ABI43_0_0React::ABI43_0_0RCTNativeModule::invoke(unsigned int, folly::dynamic&&, int) + 92 16 libdispatch.dylib 0x11c0cc876 _dispatch_call_block_and_release + 12 17 libdispatch.dylib 0x11c0cda56 _dispatch_client_callout + 8 18 libdispatch.dylib 0x11c0d408b _dispatch_lane_serial_drain + 718 19 libdispatch.dylib 0x11c0d4c31 _dispatch_lane_invoke + 400 20 libdispatch.dylib 0x11c0df6de _dispatch_workloop_worker_thread + 772 21 libsystem_pthread.dylib 0x7fff6bff208f _pthread_wqthread + 326 22 libsystem_pthread.dylib 0x7fff6bff101b start_wqthread + 15

PanMan commented 2 years ago

I have the same issue, and suspect it has to do with the fetch() in the example. that will load the complete file in memory (which can be hundreds MB with a video). I also wonder why it does fetch, and not FileSystem.readAsStringAsync .

Stroi commented 2 years ago

Also experiencing this issue, after some time of uploading videos crashes on this: const uploadTask = uploadBytesResumable(fileRef, blob, metadata);

raspverry commented 2 years ago

i'm having the same issue. it crashes when I try to upload images. Only didn't crash a few times, but mostly crashing. Im not sure why. Has anyone got the solution? edit) I found it's working in android but not not in ios for IOS, I think converting to blob is working. but having error in const result = uploadBytes(fileRef, blob)

NaikDeepak commented 2 years ago

Having the same issue on ios, working fine on android devices, it worked on ios for sometime and again started crashing with the following error in diagnostics Application Specific Information: dyld4 config: DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: ' -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]' terminating with uncaught exception of type NSException abort() called

jackblackCH commented 2 years ago

Same here! Sending the blob through storageRef.put(blob) or uploadBytes(blob...,) crashes in 90%, tried with firebase 9 in compat and standalone mode.

cpon00 commented 2 years ago

Hello, also experiencing this issue. Followed documentation on the Full Example from Firebase Web: Upload Files. During const uploadTask = uploadBytesResumable(fileRef, blob, metadata);, Expo Go on iOS crashes 90% of the time. Using Firebase v9.6.6 and Expo v43.0.0.

edi commented 2 years ago

Hello. Any news on this one? There is also a thread about it on Firebase's end, but nobody seems to be able to help, on either side, Firebase or Expo.

We get the same exact behaviour, with the same exact error, expo go client crashes without any other errors.

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 
[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]

Firebase related issue: https://github.com/firebase/firebase-js-sdk/issues/5848

cathorkay commented 1 year ago

See this thread https://github.com/firebase/firebase-js-sdk/issues/5848#issuecomment-1239542303.

People can't upload any file over 2mb

mike-javascript commented 1 year ago

Is this error, which, as far as I understand, is due to Expo and the file size, only occurring in development, or does it not work in production either?