Android MultiDex & Gradle Error

This is my first time posting a thread, don’t judge, thanks.

I have been tackling this problem for the past 3 hours and I have been losing my mind. I added Appodeal plugin to my Unity. While building my app Unity gives me this error:
4014871--346795--Helpmeee.PNG

I have followed the steps of the following: Android Gradle Build Error - Questions & Answers - Unity Discussions AND https://www.appodeal.com/sdk/unity_multidex but everything I did, nothing worked out.

When I go to Player—>Publishing Settings and enable “Custom Gradle Template”, the Gradle build fails and shows this in the console:

I am really lost and don’t know what to do. I appreciate all the help and thank you guys in advance.
Stay Frosty.

Probably it’s too late, found your question during searching the answer for another gradle related problem. In case someone with the same problem will find this post, the solution to the problem is this:
https://stackoverflow.com/questions/51420525/unity-gradle-multidex-support-is-not-working