Adyen / adyen-android

Adyen Android Drop-in and Components
https://docs.adyen.com/checkout/android
MIT License
119 stars 66 forks source link

Build warning: multiple substitutions specified in non-positional format #1522

Closed plastiv closed 3 weeks ago

plastiv commented 1 month ago

Describe the bug

Running a build with adyen dependency results in spammy warnings, like

.gradle/caches/transforms-4/1044504a0008d4c1b7758cb6d0475b4e/transformed/card-5.2.0/res/values-pt-rBR/values-pt-rBR.xml: Multiple substitutions specified in non-positional format of string resource string/checkout_card_installments_option_regular_with_price. Did you mean to add the formatted="false" attribute?

To Reproduce Steps to reproduce the behavior:

  1. Run a build with adyen sdk without gradle build cache (the warning is only printed when transformation is performed, not every build)

Expected behavior No warnings, it's unnecessary and is just distracting 😄

Additional context Since you are open source I see that strings are indeed have multiple variables inside the value:

https://github.com/Adyen/adyen-android/blob/develop/card/src/main/res/values-es-rES/strings.xml#L35

%sx %s

So it's just a warning that to support left-to-right languages you may want to update references to next style:

%1$sx %2$s

https://stackoverflow.com/a/48347534

jreij commented 1 month ago

Hi @plastiv, thanks for reporting this. We will investigate and update this issue once we have a fix.

OscarSpruit commented 3 weeks ago

Hi, we just released 5.3.1 in which this issue should be fixed.