question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-native@0.62.x crash for base64 urls sharing on iOS platform

See original GitHub issue

Steps to reproduce

  1. Use react-native@0.62.2 and react-native-share@3.3.3
  2. Try to share an image with this code:
        await Share.open({
          url: `data:image/jpg;base64,${<any base64 image code here>}`,
        });
  1. iOS Application will be crashed with logs:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSURLResponse allHeaderFields]: unrecognized selector sent to instance 0x600001d57120'
*** First throw call stack:
(
	0   CoreFoundation                      0x00007fff23e3cf0e __exceptionPreprocess + 350
	1   libobjc.A.dylib                     0x00007fff50ba89b2 objc_exception_throw + 48
	2   CoreFoundation                      0x00007fff23e5dc34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
	3   CoreFoundation                      0x00007fff23e4190c ___forwarding___ + 1436
	4   CoreFoundation                      0x00007fff23e43bf8 _CF_forwarding_prep_0 + 120
	5   Brandgility                         0x00000001030a8acc +[SKResponseInfo shouldStripReponseBodyWithResponse:] + 76
	6   Brandgility                         0x00000001030a89a1 -[SKResponseInfo initWithIndentifier:timestamp:response:data:] + 241
	7   Brandgility                         0x0000000103082779 __71-[FLEXNetworkRecorder recordLoadingFinishedWithRequestID:responseBody:]_block_invoke + 825
	8   libdispatch.dylib                   0x00000001067a1f11 _dispatch_call_block_and_release + 12
	9   libdispatch.dylib                   0x00000001067a2e8e _dispatch_client_callout + 8
	10  libdispatch.dylib                   0x00000001067a96fd _dispatch_lane_serial_drain + 788
	11  libdispatch.dylib                   0x00000001067aa28f _dispatch_lane_invoke + 422
	12  libdispatch.dylib                   0x00000001067b5b65 _dispatch_workloop_worker_thread + 719
	13  libsystem_pthread.dylib             0x00007fff51c08a3d _pthread_wqthread + 290
	14  libsystem_pthread.dylib             0x00007fff51c07b77 start_wqthread + 15
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Expected behaviour

IOS application successfully launches Share modal

Actual behaviour

IOS application crashes

Environment

  • react-native@0.62.2:
  • iOS 13.5.1

react-native-share

react-native-share@3.3.3

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:38

github_iconTop GitHub Comments

8reactions
MateusAndradecommented, Jun 17, 2020

I’m testing the example App with #803 and apparently I’m having the same problem when I’m trying to share any Image with base64 with rn@62.2. 🤔

Did you get anything about that @Kta-M , @arrygoo ?

Edit:

I tested the suggestion from https://github.com/react-native-community/react-native-share/issues/789#issuecomment-636280258 and the example app is now working without any problem. 🎉

Can you try that @oleksandr-dziuban ?

2reactions
MateusAndradecommented, Jun 15, 2020

This may have been the cause 👀 #789 (comment)

Thanks for sharing this. I will give a try updating the example project to this version.

@oleksandr-dziuban would you mind testing this on your project? Unfortunately, I need to update the example to 0.62.2. 😅

Read more comments on GitHub >

github_iconTop Results From Across the Web

[0.62.0] Image with data:image/png;base64 crashing on iOS
Following the official example in the documentation https://reactnative.dev/docs/images#uri-data-images, the loading of an image using data: ...
Read more >
React Native App crashing on ios 15.4.1 - Apple Developer
Hello Apple Team, We are facing bunch of Crashes with our app especially on OS - 15.4.1 - iPad. Our Application Build in...
Read more >
React-Native: Convert image url to base64 string
What would be the best option to do this in react native? javascript · image · base64 · react-native · Share.
Read more >
Rn-fetch-blob - npm.io
Features · Transfer data directly from/to storage without BASE64 bridging · File API supports regular files, Asset files, and CameraRoll files · Native-to-native ......
Read more >
Kony Visualizer API Developer's Guide
Added createUUID and getDeviceId APIs as part of the kony.os ... Shared App Group Container API for iOS: The Shared App Group Container...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found