I got the following error testing on Android 5.0 (API 21). Tested on other OS versions works well.
java.lang.RuntimeException: Unable to start activity
Recently I faced the same, There is an issue which is mentioned over here, which is not solved yet. The crash only occurs on API 21.
There are few solutions which mention downgrading the androidx.appcompat:appcompat
versions. This answer helped me. Also, there are other possible workarounds mentioned, pick the answer that applies to you.
EDIT: The crash also occurs on API 22 and 23 if the user doesn't have Google Play installed.
EDIT 2: As mentioned in the issue tracker here, and upgrading the androidx.appcompat:appcompat
version to 1.2.0-alpha02 is providing the fix in some cases. Please go through a detailed discussion to find a suitable workaround.
As mentioned by @MiguelSlv adding this maven repository is a temporary fix, However, all the above workarounds have side effects. As the bug is not fixed yet, it is not a clean solution.
EDIT 3: As of May, 2020, there is a fix.
implementation 'androidx.appcompat:appcompat:1.2.0-beta01'
Previous not working version:
implementation 'androidx.appcompat:appcompat:1.1.0'