Uninstalling the react-native-dotenv package and then removing the react-native-dotenv from babel.config.js file. Then using the command npx expo start -c command fixed the issue for me.