Bundle Identifier mismatch on APK upload to Google Play

So, I’ve got a really strange problem.

I wanted to change my bundle identifier (package name) in Player Settings.

Let’s say the package name was com.oldcompany.oldapp and I changed it to com.newcompany.newapp

Now, when I builld an APK and upload it to google play, it throws an error:

You need to use a different package name because “com.oldcompany.oldapp” is already used by one of your other applications.

The bundle identifier is somehow mismatched (it finds the old one) even though it’s definitely changed to “com.newcompany.newapp” in the Player Settings (I tried to restart Unity, but nothing seems to be working).
Note: The app with the old package name that google play is complaining about is unpublished. I’ve created a new app and I wanted to upload it under different identifier & keystore.

Any ideas what could be causing this?
Thanks.

If anyone is struggling with the same issue and comes across this thread - I was forcing the old bundle identifier in mainTemplate.gradle, so simply changing the identifier in Player Settings wasn’t enough since it was being forced from the gradle file. Renaming it in mainTemplate.gradle solved the issue.