facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
118.75k stars 24.29k forks source link

Exception - [NSNull length] unrecognized selector #22856

Closed Eladossa closed 5 years ago

Eladossa commented 5 years ago

I'm new at React Native, apologize in advance. Sometimes, but not always when the app is loaded for the first time and the main screen is showen, I get this error -

Exception '-[NSNull length]: unrecognized selector sent to instance 0x1e6c059b0' was thrown while invoking multiSet on target AsyncLocalStorage with params ( ( ( "@Ye-Music:songs", "null" )

The function that made the error - `async componentDidMount() {

 await this.allSongs();

}

allSongs = () => { console.log("allSongs function begin!"); fetch(URL + "/SongsList", { body: null, method: "POST", headers: { Accept: "application/json", "Content-type": "application/json; charset=UTF-8" } }) .then(res => { return res.json(); }) .then(songsResult => { AsyncStorage.setItem("@Ye-Music:songs", songsResult.d); }) .catch(err => { console.error(err); }); }; `

Can anyone please tell me why is this erorr happening and howto solve it?

react-native-bot commented 5 years ago

We are automatically closing this issue because it does not appear to follow any of the provided issue templates.

Please make use of the bug report template to let us know about a reproducible bug or regression in the core React Native library.

If you'd like to propose a change or discuss a feature request, there is a repository dedicated to Discussions and Proposals you may use for this purpose.

Eladossa commented 5 years ago

why others can submit their questions and I can't ? This is the place not stackOverflow!

This is React native here !