Tell us which versions you are using:
Tell us to which platform this issue is related
On the simulator, after selecting image from library, we should be able to process the image (in my case I am posting it to the server).
After selecting an image/images OR just closing the image selecting modal, the simulator freezes (this occurring before posting or any processing). Initially, I thought it was a bug in my code, but traced the error all the way back to the openPicker method. In addition, when trying to send the image returned (an image is still returned even though the simulator freezes), I get the errors shown below in Chrome console.
This does not happen on an actual device. I wonder if it is related to this issue: https://github.com/facebook/react-native/issues/29364
Also important to note is that I only started to receive this error after updating to the latest version of react-native (0.63.1). I did not have any of these issues in RN 0.62.
I am wondering if there are two issues at play here;
One issue could be related to animation/gestures and
Another related to actually sending the image to the server.
The reason I think the issues are separate, is because regardless of whether I select an image or not, the simulator freezes. However, if I open the modal to select an image the simulator freezes AND I receive the errors shown below in the Chrome console.
I receive the following errors in Chrome console
Missing request token for request:
Error processing request body: Error Domain=RCTErrorDomain Code=0 "Invalid request token." UserInfo={NSLocalizedDescription=Invalid request token.}
For all of you with iOS native dev experience, I receive the following errors in Xcode
2020-07-22 09:10:39.575509+1000 FitPlace[32558:801024] [native] [GESTURE HANDLER] Initialize gesture handler for root view
2020-07-22 09:11:09.014235+1000 FitPlace[32558:801240] [javascript]
2020-07-22 09:11:10.139509+1000 FitPlace[32558:801024] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=7 "(null)""
2020-07-22 09:11:14.190836+1000 FitPlace[32558:801240] [javascript]
2020-07-22 09:11:14.414287+1000 FitPlace[32558:801862] [native] Missing request token for request:
2020-07-22 09:11:14.431963+1000 FitPlace[32558:801862] [native] Missing request token for request:
2020-07-22 09:11:14.436436+1000 FitPlace[32558:801024] Warning: Attempt to present
2020-07-22 09:11:14.443977+1000 FitPlace[32558:801862] [native] Missing request token for request:
2020-07-22 09:11:14.444786+1000 FitPlace[32558:801024] Warning: Attempt to present
2020-07-22 09:11:14.456065+1000 FitPlace[32558:801862] [native] Error processing request body: Error Domain=RCTErrorDomain Code=0 "Invalid request token." UserInfo={NSLocalizedDescription=Invalid request token.}
2020-07-22 09:11:14.456921+1000 FitPlace[32558:801024] Warning: Attempt to present
2020-07-22 09:11:14.460264+1000 FitPlace[32558:801024] Warning: Attempt to present
Trigger image selection modal with ImagePicker.openPicker with options: {multiple: true,
mediaType: "photo"}
Click 'Cancel' on the modal -> the simulator will freeze
OR Select an image from the modal -> errors shown in Chrome console AND simulator will freeze
Love react-native-image-crop-picker? Please consider supporting our collective:
馃憠 https://opencollective.com/react-native-image-crop-picker/donate
same issue
me too
Same issue.
@ivpusic have you fixed this issue? i saw you release 0.33.2 yesterday ... seems not work
same issue
react-native-image-crop-picker: 0.33.2
react-native: 0.63.2

Ps: this solution is no more necessary if you update the react-native to 0.63.3, as mentioned below.
This problem is not related to this lib, but with the react-native one as reported here. The temporary solution that I am using is:
1 - Modify the function (id)sendRequest:(NSURLRequest *)request withDelegate: that exists in node_modules/react-native/Libraries/Image/RCTImageLoader.mm to this code here
2 -Install the libs responsible to generate patch-package
yarn add patch-package postinstall-postinstall
or
npm i patch-package
3 - Add a script to run the postinstall
"scripts": {
...
"postinstall": "patch-package"
4 - Create the patch that will override the node-modules with this fix
npx patch-package react-native

5 - Run the pod install and run your iOS app react-native run-ios
6 - The upload might work again.
PS: These are the changes I have done:
If this solutions does not fix the problem, please try to clear your iOS cache by removing the Pods (rm -rf Pods) and/or the DerivedData (rm -rf ~/Library/Developer/Xcode/DerivedData).
This problem is not related to this lib, but with the
react-nativeone as reported here. The temporary solution that I am using is:
1 - Modify the function(id)sendRequest:(NSURLRequest *)request withDelegate:that exists innode_modules/react-native/Libraries/Image/RCTImageLoader.mmto this code here2 -Install the libs responsible to generate
patch-packageyarn add patch-package postinstall-postinstall or npm i patch-package3 - Add a script to run the postinstall
"scripts": { ... "postinstall": "patch-package"4 - Create the patch that will override the node-modules with this fix
npx patch-package react-native
5 - Run the
pod installand run your iOS appreact-native run-ios6 - The upload might work again.
PS: These are the changes I have done:
If this solutions does not fix the problem, please try to clear your iOS cache by removing the Pods (
rm -rf Pods) and/or the DerivedData (rm -rf ~/Library/Developer/Xcode/DerivedData).
Thanks a lot!!!
I was struggled in last two days, I just followed your instruction, finally iOS image upload working fine for me
I just update react-native from 0.63.2 to 0.63.3, it fixed the issue for me 馃槈
upgrade react-native to version 0.63.3
Update node_modules/react-native/Libraries/Image/RCTImageLoader.mm.
https://github.com/facebook/react-native/pull/29595/files
I just update react-native from 0.63.2 to 0.63.3, it fixed the issue for me 馃槈
this works for me too
@roni-castro solution works for me.
Most helpful comment
Ps: this solution is no more necessary if you update the react-native to 0.63.3, as mentioned below.
This problem is not related to this lib, but with the
react-nativeone as reported here. The temporary solution that I am using is:1 - Modify the function
(id)sendRequest:(NSURLRequest *)request withDelegate:that exists innode_modules/react-native/Libraries/Image/RCTImageLoader.mmto this code here2 -Install the libs responsible to generate
patch-package3 - Add a script to run the postinstall
4 - Create the patch that will override the node-modules with this fix
5 - Run the
pod installand run your iOS appreact-native run-ios6 - The upload might work again.
PS: These are the changes I have done:
If this solutions does not fix the problem, please try to clear your iOS cache by removing the Pods (
rm -rf Pods) and/or the DerivedData (rm -rf ~/Library/Developer/Xcode/DerivedData).