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>