My project was running fine on the simulator, but not on the device. After some troubleshooting, I discovered that my phone's storage was full, which was causing the issue. Once I deleted some images and videos, the project started running on the device again.