So I was trying to build my project and I keep getting the same error over and over again. I tried switching to Internal but then it just keeps crashing and the game wont run on any device. I tried reinstalling the Unity version which didn’t work neither.
I found the problem. It was an asset that I downloaded earlier. I built it with internal and then tested it in the Test Lab on Firebase and the asset I had had a bunch of errors and also used a custom gradle template and that was my problem. I deleted it and now I can build with gradle.