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

[0.62.2] Using base64 strings for an Image URI crashes app #28583

Closed
RnbWd opened this issue Apr 10, 2020 · 19 comments
Closed

[0.62.2] Using base64 strings for an Image URI crashes app #28583

RnbWd opened this issue Apr 10, 2020 · 19 comments
Labels
Component: Image Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Resolution: Locked This issue was locked by the bot.

Comments

@RnbWd
Copy link

RnbWd commented Apr 10, 2020

Description

I'm using base64 strings as image sources throughout my app. After upgrading react-native from 0.61.5 to 0.62.2, my app crashes immediately upon loading any image with the source as {"uri": 'base64encodedstring'}. There are no logs prior to the app crashing. My app uses data:image/jpeg;base64 encoded strings.

React Native version:

System:
OS: macOS 10.15.4
CPU: (4) x64 Intel(R) Core(TM) i5-5250U CPU @ 1.60GHz
Memory: 101.43 MB / 8.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 13.11.0 - ~/.nvm/versions/node/v13.11.0/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.13.7 - ~/.nvm/versions/node/v13.11.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.8.4 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.4, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 27, 28, 29
Build Tools: 28.0.3, 29.0.2
System Images: android-26 | Google APIs Intel x86 Atom_64, android-28 | Google APIs Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom_64
Android NDK: Not Found
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6241897
Xcode: 11.4/11E146 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_232 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: 16.11.0 => 16.11.0
react-native: 0.62.2 => 0.62.2
npmGlobalPackages:
react-native: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Use {"uri": 'base64encodedstring'} as an Image source inside of a component

Expected Results

Image loads properly

@myckhel
Copy link

myckhel commented Apr 10, 2020

Same issue here with rn v62.2

@hramos hramos added Component: Image Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. and removed Needs: Triage 🔍 labels Apr 10, 2020
@github-actions
Copy link

⚠️ Missing Reproducible Example
ℹ️ It looks like your issue is missing a reproducible example. Please provide a Snack or a repository that demonstrates the issue you are reporting in a minimal, complete, and reproducible manner.

@guhungry
Copy link
Contributor

guhungry commented Apr 11, 2020

version 0.62.1 also affected, this is ios only issue.

@hramos minimal repro as below

<Image style={{ width: 1, height: 1 }} source={{ uri: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACklEQVR4nGP6DwABBQECz6AuzQAAAABJRU5ErkJggg==" }} />
Stack trace

2020-04-11 17:37:57.894430+0700 CropManagement[33457:589252] -[NSURLResponse allHeaderFields]: unrecognized selector sent to instance 0x60000132a440
2020-04-11 17:37:57.898908+0700 CropManagement[33457:589252] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSURLResponse allHeaderFields]: unrecognized selector sent to instance 0x60000132a440'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff23e3dcce __exceptionPreprocess + 350
1 libobjc.A.dylib 0x00007fff50b3b9b2 objc_exception_throw + 48
2 CoreFoundation 0x00007fff23e5e9f4 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x00007fff23e426cc forwarding + 1436
4 CoreFoundation 0x00007fff23e449b8 _CF_forwarding_prep_0 + 120
5 CropManagement 0x000000010673f18c +[SKResponseInfo shouldStripReponseBodyWithResponse:] + 76
6 CropManagement 0x000000010673f061 -[SKResponseInfo initWithIndentifier:timestamp:response:data:] + 241
7 CropManagement 0x0000000106718e39 __71-[FLEXNetworkRecorder recordLoadingFinishedWithRequestID:responseBody:]_block_invoke + 825
8 libdispatch.dylib 0x0000000109e6ff11 _dispatch_call_block_and_release + 12
9 libdispatch.dylib 0x0000000109e70e8e _dispatch_client_callout + 8
10 libdispatch.dylib 0x0000000109e776fd _dispatch_lane_serial_drain + 788
11 libdispatch.dylib 0x0000000109e7828f _dispatch_lane_invoke + 422
12 libdispatch.dylib 0x0000000109e83b65 _dispatch_workloop_worker_thread + 719
13 libsystem_pthread.dylib 0x00007fff51b9f6fc _pthread_wqthread + 290
14 libsystem_pthread.dylib 0x00007fff51b9e827 start_wqthread + 15
)
libc++abi.dylib: terminating with uncaught exception of type NSException

@RnbWd
Copy link
Author

RnbWd commented Apr 13, 2020

I've only tested this issue on iOS

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels Apr 13, 2020
@daniel-sudz
Copy link

daniel-sudz commented Apr 15, 2020

Edit:
For anyone else that comes across this just change the version of Flipper in the podfile to

  versions['Flipper'] ||= '~> 0.37.0'

as this is what the pr did

@weslei-dias-vakt
Copy link

@daniel-sudz you are a hero. Thank you.

@imchathu87
Copy link

@daniel-sudz shut the front door ... you are a life savior

@Shariaty
Copy link

@daniel-sudz You saved my life. TNX man.

@justcodejs
Copy link

I am using React Native 62.2 and changing versions['Flipper'] ||= '~> 0.37.0' solved my problem too. :)

JustCode
https://justnice.net/wp/blog/

@Ding95
Copy link

Ding95 commented May 8, 2020

Edit:
For anyone else that comes across this just change the version of Flipper in the podfile to

  versions['Flipper'] ||= '~> 0.37.0'

as this is what the pr did

You perhaps should change the version of Flipper-Folly

versions['Flipper-Folly'] ||= '~> 2.2'

Ferossgp added a commit to status-im/status-mobile that referenced this issue May 8, 2020
Ferossgp added a commit to status-im/status-mobile that referenced this issue May 8, 2020
facebook/react-native#28583
Signed-off-by: Gheorghe Pinzaru <feross95@gmail.com>
@riteshapatel
Copy link

riteshapatel commented May 19, 2020

Along with the flipper update I also had to update,

  versions['Flipper-Folly'] ||= '~> 2.2'
  versions['Flipper-RSocket'] ||= '~> 1.1'

After updating versions in the pod file run

cd ios && pod install --repo-update && cd ..

Cheers!

@ganes1410
Copy link

I can also confirm the updating the version fixes this issue.

@tushar-innovalabs
Copy link

Thanks for the solution @daniel-sudz and @riteshpatel

@ismail2009
Copy link

@daniel-sudz Thanks a lot

@alanyong91
Copy link

Edit:
For anyone else that comes across this just change the version of Flipper in the podfile to

  versions['Flipper'] ||= '~> 0.37.0'

as this is what the pr did

the real contributor !

@patelgaurav4u
Copy link

Edit:
For anyone else that comes across this just change the version of Flipper in the podfile to

  versions['Flipper'] ||= '~> 0.37.0'

as this is what the pr did

working fine with this changes

@pavermakov
Copy link

I get the following error when I try to upgrade flipper
Снимок экрана 2020-08-06 в 13 07 21

@kkkasio
Copy link

kkkasio commented Aug 14, 2020

Edit:
For anyone else that comes across this just change the version of Flipper in the podfile to

  versions['Flipper'] ||= '~> 0.37.0'

as this is what the pr did

I had the same problem here!
its worked for me <3

@safaiyeh
Copy link
Contributor

Along with the flipper update I also had to update,

  versions['Flipper-Folly'] ||= '~> 2.2'
  versions['Flipper-RSocket'] ||= '~> 1.1'

After updating versions in the pod file run

cd ios && pod install --repo-update && cd ..

Cheers!

Closing as we have a fix, thanks everyone

@facebook facebook locked as resolved and limited conversation to collaborators Oct 1, 2021
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Oct 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: Image Needs: Attention Issues where the author has responded to feedback. Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests