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
This answer I am writing in Mar, 2020, could be changed after that.
In my case , in build.gradle (app level)
, I changed
implementation 'androidx.appcompat:appcompat:1.0.0'
to
implementation 'androidx.appcompat:appcompat:1.2.0-alpha02'
and the Problem is solved.
Other configuration I already have, but I didn't change them:-
classpath 'com.android.tools.build:gradle:3.5.3'
gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
gradle app level
android {
compileSdkVersion 29
buildToolsVersion '29.0.2'
...
}
Noting that this solution is tested on real device with android version 5