3

We have started to see random errors in a Xamarin Android build in Azure DevOps that appear to be related to the localization of resource files:

/Users/runner/work/1/s/Apps/MyApp/MyApp.Droid/obj/Release/lp/187/jl/res/values-hu/values.xml(1): error APT2254: xml parser error: no element found.
/Users/runner/work/1/s/Apps/MyApp/MyApp.Droid/obj/Release/lp/187/jl/res/values-hu/values.xml : error APT2261: file failed to compile.
/Users/runner/work/1/s/Apps/MyApp/MyApp.Droid/obj/Release/lp/187/jl/res/values-hu/values.xml(1): error APT2254: xml parser error: no element found.
/Users/runner/work/1/s/Apps/MyApp/MyApp.Droid/obj/Release/lp/187/jl/res/values-hu/values.xml : error APT2261: file failed to compile.

We don't support localization in our app so I don't understand why the build is trying to create localized versions of the resources. We still see the error even if we specify <AndroidResgenExtraArgs>-c en</AndroidResgenExtraArgs> in the project.

The build doesn't always fail and when it does it fails for different language codes. We don't see the issue when building locally but this could because we would normally be building for debug.

Have we misunderstood what is happening here? What could be the cause of the issue?

MobileDev
  • 189
  • 7
  • Here is a [ticket](https://stackoverflow.com/questions/63839510/xamarin-android-build-in-failing-in-azure-pipeline) with similar issue you can refer to. – Jeff Apr 29 '21 at 10:10
  • Any news on this? We have the same 4 issues sometimes, e.g.: `/202/jl/res/values-el/values.xml(1): error APT2254: xml parser error: no element found.` , `etc.....`. The **worst** thing this happens when we build the iOS version!! Luckily not always happens, so a restart usually "fixes" this, but very frustrating. – Zoli Jun 07 '21 at 13:34
  • I'm afraid not, we've tried turning off localisation for the projects affected but we still randomly see the error, at the moment I'm assuming it's some issue in the Xamarin tooling which will hopefully get fixed at some point. – MobileDev Jun 08 '21 at 14:03
  • It might be your project has a mixture of packages referencing AndroidX and old Android.Support libraries. Then, [according to this issue](https://github.com/xamarin/xamarin-android/issues/5490), sometimes those values.xml files will be empty. – badasta Jan 24 '22 at 16:59

0 Answers0