KjellConnelly / react-native-shared-group-preferences

127 stars 57 forks source link

App terminating with uncaught exception of type NSException #23

Open jonesaustindev opened 3 years ago

jonesaustindev commented 3 years ago

I started a new RN project today so most current version of stable RN. When I am running the app and trying to pull in data from the defaults I get this error

Terminating app due to uncaught exception 'NSFileHandleOperationException', reason: '*** -[NSConcreteFileHandle fileDescriptor]: Invalid argument'
terminating with uncaught exception of type NSException

The data actually is coming correctly when the app is first ran and prints out the data from react native in the iOS app group (swift), but eventually hits this exception either right at startup, or after a minute or two.

KjellConnelly commented 3 years ago

Not really sure about this. I'm using 0.63.4 of react-native, and I'm not getting this error. Did you setup app groups with the proper identifier format? ie: group.<group name>? That's all I can think of at the moment, and a quick google search didn't come up with anything relevant I could think of.

jonesaustindev commented 3 years ago

@KjellConnelly yes it is setup correctly. The data comes in no problem, just keeps getting this exception at runtime or after a minute or two of the app running. Is there a demo app somewhere I could compare mine to maybe?

KjellConnelly commented 3 years ago

Nope sorry I don't have one. I wrote the library as I was writing my current app which I've probably put 3000 hours into, so app saving in my app is tied to saving to device, server, etc. Very complicated. You can try to run this with xcode and modify the node_modules folder directly to see where you're getting the error exactly. Not sure if you've done that sorta thing before, but that's probably your best bet in debugging this issue as I don't know how to reproduce it on my end.

jonesaustindev commented 3 years ago

Alright thank you @KjellConnelly I'll give that s shot.