AAPT: error: unexpected element queries found in manifest.

I’m trying to add Facebook’s Audience Network 6.2.1 to my Unity project. When I try to build APK, I get this error and I couldn’t build

AndroidManifest.xml:38: AAPT: error: unexpected element <queries> found in <manifest>.

I tried all the methods in this thread Android - Crash on startup caused by incompatibilities in dependencies · Issue #303 · facebook/facebook-sdk-for-unity · GitHub but I still get that error.

this thread android - How can I fix "unexpected element <queries> found in <manifest>" error? - Stack Overflow says to update gradle but how do I update Unity’s gradle? How do I check Unity’s gradle’s version?

I tried downloading Gradle 6.8 from Gradle | Installation and set Unity’s gradle path in Preferences > External Tools to that new version but I still get the error

I’ve found the solution by following the Answer here by @AppLovin_MaxB. Quoted the answer here for folks who found this question from Google

Hey everyone,

Just a heads up, the best fix is to
skip updating Gradle as it might lead
to further issues and use Android
Gradle Plugin version 3.4.3 (at least
for most versions of Unity). So you
should change this line

classpath
‘com.android.tools.build:gradle:3.4.0’
to

classpath
‘com.android.tools.build:gradle:3.4.3’
in the baseProjectTemplate.gradle
file.

This issue and a fix for it is
actually described in the AppLovin MAX
documentation here:
MAX Mediation Documentation