Execution failed for task ':app:packageDebug'. Failed to generate v1 signature

I’m building my ionic app for the android platform using the command

ionic cordova build android

I’m always getting this error.

BUILD FAILED in 11s
/home/ashleypow/Documents/InfoSecDevelopers/Projects/To-Do-App/To-Do-App/platforms/android/gradlew: Command failed with exit code 1 Error output:
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:packageDebug'.
> Failed to generate v1 signature

I tried all the solutions from stackoverflow and ionicforum but nothing seems to work.
Could someone please help. I’m stuck on this for the past 3 days.
Thanks in advance!