At first i generated an apk normally using a key store i created, it worked but when i made some changes to a layout and an activity and tried generating an apk again, an error inside a generated build file of the modified layout interrupts the build process, the file is named after the layout which is like this "LayoutNameBinding.java"
Heres a screenshot of the error source error source
Heres the output of the build build output
Looks like this issue is related to this post.
Try the following:
Hopefully, this should solve the issue.