Ionic build command was working fine until I decided to add some custom splash screen and run the following command,
ionic resources
Delete the Android platform and give full permission to the public to the platform folder.