Closed kartik0198 closed 3 years ago
@kartik0198,
Thanks for that. Just tested and reproduced.
Context (in case you're curious):
When the library targeted SDK 28, setPadding
did not exist on GradientDrawable
(which our Labels use for backgrounds). So when we called setPadding previously, we were setting it on the TextView itself (which Label derives from).
It seems that Android added a setPadding
on GradientDrawables in SDK 29 however. So now that the library targets SDK 30 as of the last update, it tries to use the newer setPadding method that does not exist on devices below 29. Unintended consequence of the new target version. Working on a fix right now and will make sure I test on multiple Android versions before publishing. Will update this thread when it's published.
Thanks for the update and yes it was unintended consequence of the new target version. You may test with strict mode's detectNonSdkApiUsage() to avoid bugs like these in future. :)
Thanks for the update and yes it was unintended consequence of the new target version. You may test with strict mode's detectNonSdkApiUsage() to avoid bugs like these in future. :)
I don't think this would have caught the issue at hand. That Strict Mode policy only catches use of illegal non-SDK APIs through reflection, correct? Whereas for this bug, there was just ambiguity on which legal SDK API to use (a new method of the same name just so happened to be added to a class, so we were unintentionally using this new legal method instead of an old legal method).
Hey @kartik0198,
Bug fixed (if curious, this was the only change needed to the Label
class). I tested all the way down to SDK 19 (some of those tests were done on emulators though, I don't have physical devices running old Android versions unfortuntately).
v1.2.1 is already pushed to master branch, and should be available via Maven Central soon. It should fix your problem, but let me know if it doesn't. Thanks for spotting this!
Sure, I will let you know! Thanks.
My app is crashing on startup when I updated my library version to 1.2.0 Please see the following logs. compileSdkVersion = 31 minSdkVersion = 21 targetSdkVersion = 30