Don’t know if anyone else has the same issue but I faced a really annoying SDK problem with Unity 2019.4.14. I was using Firebase 6.15.1 in my project but to publish my game with latest XCode I had to upgrade my Firebase SDK to 7.0.1, everything worked fine with IOS but on the other hand Android builds started to fail. This error AAPT: error: unexpected element <queries> found in <manifest>.directs that the gradle version 5.1.1 which came with Unity 2019.4.14 does not support this new Firebase SDK. So I have to use gradle besides the one installed with Unity. Is there any option to update the gradle version which came with UnityHub to 5.6.4, as far as I can see only 2020.1 and above delivers this version but I’m not ready yet to upgrade from 2019.4.
same problem, unity 2019.4.16 -unexpected element found in -Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Same problem here after updating Firebase and AdMob! Any ideas how to solve?
I also am on 2019.4 and have no intention to migrate to 2020 since every time I change major Unity version I spend MONTHS debugging and lose thousands of users due to new bugs introduced by Unity
Yes. The issue is resolved by following the instructions on in the above or just updating to 2020. I chose the latter as we are already fairly up to date, but the other Gradle options should work for you.
After a lot of tests and builds (with or without AdMob, update or not Firebase…), I see that the problem come from Unity mediation plugin in AdMob. If I just update Firebase to 7.0.2 and AdMob to 5.4 with no mediation plugins, it’s ok.
I have changed the UnityMediationDependencies.xml file, to replace the “3.6.0.0” version by the previous version “3.5.1.1”. Now the build is ok
So no need to use the custom Gradle for Android 11 and I keep the Unity default Gradle
If I add the Facebook mediation, the Unity mediation downloaded version switch to 3.6 and don’t use correctly the UnityMediationDependencies.xml (still contains 3.5.1.1). I am looking for a solution…
For anyone who have trouble after applying changes on this google document, add Custom Launcher Gradle Template and get “Lint Infrastructure Error”, this post solved my case https://discussions.unity.com/t/784710/9
I followed the instruction provided by unity_BUIockkbCwDQ9w but it did not worked so I had to perform extra steps which I want to share with you. I am using Unity 2018.4.28f1 and trying to update Firebase to 8.0.0, AdMob to 6.0.1. Here are the steps I did:
Delete both Assets/Freibase and Assets/GoogleMobileAds folder before you import plugins. Otherwise there could be issue with “java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class com.google.unity.ads.AdNetworkExtras found in modules jetified-googlemobileads-unity-runtime.jar :)googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)”.
Within Assets/Plugins/Android/mainTemplate.gradle I had to change gradle plugin’s version to classpath ‘com.android.tools.build:gradle:4.2.0’ to support gradle-6.9 (which you can download from here and place somewhere C:\Users\YOURUSERNAME\AppData\Local\Android as instructed here). Do not forget to added google() to buildscript { repositories { and allprojects { repositories {.
NOTE: I tried different versions too but 5.1.1 is not enough, 5.6.4 is enough but it has lots of issues. You fix one, another popups and I gave up after 3rd one was resolved and 4th one appeared =) You can see which version of gradle plugin you need to set for your gradle version here.
Since I am using Unity 2018.4.28f1, I was not able to enable custom gradle properties which was required. So thanks to this post, I used post build script to add those (android.useAndroidX=true) parameters.
Also you will need to modify your code a bit. AdMob no longer accepts app ID on initialization and there are no longer event for user clicked an ad, user gender or date of birth. The Firebase InstanceId was depreciated so you need to use Firebase Installations instead.
Seems like three plugins: Crashalitics, AdMob and Unity Ad do not include minSdkVersion in their AndroidManifest.xml file (when I tried to do that via tag, I got error which I could not resolve) and after compilation minSdkVersion Unity sets value to 1 which inturn forces three unnececery permissoins to be added automatically (since version less than 4). To remove those, simply add to AndroidManifest.xml file following lines:
I see no issues so far, if there will be any, I will update this thread. If you do not have AndroidManifest.xml, then copy one from %UNIT_INSTALL_DIR%Editor\Data\PlaybackEngines\AndroidPlayer\Apk to Assets\Plugins\Android I hope this will save someone’s time.