Cannot install debug and release version on same device
Okay, I figured out what was going on.
I was actually creating an unsigned apk for the debug variant (Build > Build APK). But I had to use (Build > Generate Signed APK) and then select the debug variant from the options.
Also, when running the project on my device, gradle would be generating an unsigned apk. So that too wouldn't work. That is - unless I configure SigningConfigs
as explained in this answer.
Instead of using build types, why not use product Flavors instead? Here's a link to the documentation on how to do this, as well as what you are currently trying to do. Hope this helps.