Invoke-customs are only supported starting with Android O (–min-api 26)

It is also necessary to set the minSdkVersion and targetSdkVersion according to the min api reported in the error message. build.gradle : defaultConfig { applicationId “com.mypack.myapp” minSdkVersion 26 targetSdkVersion 29 versionCode 1 versionName “2.0”

After hours of struggling, I solved it by including the following within app/build.gradle:

android {
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8

Leave a Reply