[Fix] Android 7 and lower crashes with getParameterCount calls, when the app is built with AGP 7 or older #2329
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
Fixes startup crashes with Android 7, on
getParameterCount()
, when the app is built with AGP 7 or older.Details
This method isn't compatible with Android 7 and older devices and causes a crash.
AGP 8 (Android Gradle Plugin) added compatibility for this, however its not uncommon for app developers to still be on 7.
The
getParameterCount()
was added to be cautious, however there isn't a known case where this is needed so we removed it in this PR. While it's possible to have getPropertyX and getPropertyX(param1) this isn't something that should be in our code based as this is against our coding conventionsMotivation
We want to still support Android 5-7 versions and Gradle 7.
Scope
Effects deserialization of JSON into model objects.
Related
This fixes #2323
Testing
Unit testing
No unit test changes were needed.
Manual testing
Tested on an Android 5 emulator.
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is