While attempting to package my Unreal Engine project v4.27.2 for Android ETC2, I encountered an error related to the YodoAds plugin. The build process failed with an error message that included the following: (complete log) "unexpected element <provider> found in <manifest><queries>".
I discovered that the issue was caused by a syntax error in a cached file from the gradle build. Specifically, the <provider> tag was not enclosed within<application></application> tags.
Unfortunately, I am unable to edit this file directly, as it is a cached file from the gradle build. I have reviewed all the UPL files in my project that influence AndroidManifest.xml, but have been unable to find one that added the incorrect code to the file.
Weâre encoutering the same error now with UE4.27.2, although ours is caused by a different ad providerâs SDK.
Itâs the same issue, but ours is caused by newer versions of the play-services-ads-lite package (weâre using 22.6.0). Apparently ââpropertyâ cannot be recognized in lower versions of gradle pluginâ. ( https://groups.google.com/g/google-admob-ads-sdk/c/IMdomwgNomQ )
We have managed to find a solution which we believe to be working without any problems, although we havenât released a build with these changes as of yet.
Note, I think this will only be available to you if youâre building from source as you need to modify some engine files.
Essentially we had to upgrade the version of Gradle and the Gradle Plugin that the engine uses.
First we changed UEDeployAndroid.cs located in (Engine\Source\Programs\UnrealBuildTool\Platform\Android) line 25:
Depending on what your third party libraries require, you might need to add a minimumSDKAPI entry into one of your UPL .xml files (which I assume you have and know what youâre doing with them since youâre integrating a third party sdk)
<!-- New ads SDKs require at least android-33 -->
<minimumSDKAPI>
<insertValue value="33"/>
<insertNewline/>
</minimumSDKAPI>
That doesnât need to go in any of the existing sections like <androidManifestUpdates> or anything.
You might also need to add a section in your <buildGradleAdditions> to specify the resolution strategy for androidX:
<buildGradleAdditions>
<insert>
.
.
.
configurations.all {
resolutionStrategy {
force 'androidx.core:core:1.8.0'
force 'androidx.core:core-ktx:1.8.0'
}
}
</insert>
</buildGradleAdditions>