AnsweredAssumed Answered

Upgrading to 100.4.0 breaks build due to malformed values.xml in aar

Question asked by johncarl81 on Nov 5, 2018

Upgrading to the android runtime 100.4.0 in our project we got an error stating the following:

[INFO] ...\target\unpacked-libs\cea_arcgis-android_100.4.0\res\values-ar\values-ar.xml:40: error: Multiple substitutions specified in non-positional format; did you                                                      mean to add the formatted="false" attribute? [INFO] [INFO] ...\target\unpacked-libs\cea_arcgis-android_100.4.0\res\values-ar\values-ar.xml:40: error: Unexpected end tag string [INFO] [INFO] ...\target\unpacked-libs\cea_arcgis-android_100.4.0\res\values-bs\values-bs.xml:40: error: Multiple substitutions specified in non-positional format; did you                                                      mean to add the formatted="false" attribute? [INFO] ...

Which is caused because line 40 on many (if not all?) values*.xml files in the android runtime aar have multiple %s replacements wihtout the formatted="false" flag:

<string name="arcgisruntime_error_out_of_range">"Value is outside the valid range %s to %s"</string>

The fix for this seems easy, either add the formatted="false" flag or number the replacements within the resouce following Google's guidance: String resources  |  Android Developers 

 

We are building using Maven and Netbeans and this looks to be an issue exposed by the maven-android-plugin - I am unable to get this to fail when building with Gradle.  The Maven build seems to be a bit more agressive about validating library resources than the Gradle android build.

 

Now, before you suggest that we just change our build over to Gradle, we're in the process of doing so.  I am filing this issue so that the developers will know about this and have the information to do the right thing.  I have also contacted support about this previously, but I was told that it wouldn't be a priority since our build is non-standard.

 

I have filed an issue with the android-maven-plugin as well here: Building project with malformatted aar values.xml causes build to crash · Issue #783 · simpligility/android-maven-plugin… 

Outcomes