I raised this question and answered myself as I thought it will help others who are facing similar issue. I struggled a lot to find out the real reason behind it as the error shown in terminal was not precise.
To resolve the issue please upgrade the react-native package.
-
Go to the Project root.
-
Upgrade the React native package in the Command Prompt by typing :
react-native upgrade. -
Then Accept to update all the Files by typing
y (Yes)in the Command Prompt.
Reference: https://github.com/facebook/react-native/issues/9312