Error:
The stack trace log is:
Error: Invoke-customs is only supported starting with Android O (--min-api 26)
Reason:
Probably, one of the reasons for this Invoke-customs support error is using the Lambda functions/Expressions rather than inline callbacks as the Lambda functions/Expressions are introduced in Java 8 and the application must be compatible with Java 8 to use them.
Solution (Tested and Working):
Adding the below snippet in (app/build.gradle)
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}