I have been tryong to add FCM to my android application for almost 48 hours now. I am keep on failing with these two errors on Android Studio. I have tried all the solutions
I had this occurring due to outdated build tools version. Updating from 28.0.2 to 28.0.3 resolved it.
buildToolsVersion '28.0.2'
to:
buildToolsVersion '28.0.3'
in build.gradle file.