What worked for me was going to the Build.Gradle, and going to where it says the following:
dependencies {
classpath "com.android.tools.build:gradle:4.1.1"
If you are getting the same Tag Mismatch issue I got from this error, then click on the highlighted "com.android.tools.build:gradle" part and then press alt enter.
If it asks you to sync, sync, then click it again and press Alt Enter and it should ask you to upgrade. Click yes. It will upgrade to the latest version.
Now generate your signed APK and it should work now.
That is, if the lint is highlighting it. If it isn't than I don't know what the problem is.
It could be the result of an older Gradle dependency changing and a newer one taking precedence. That's my theory. I fixed my problem anyhow.