2

Androidx and Jetifier both are enabled in gradle.properties.

android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

All the dependicies i'm using

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'
    implementation 'androidx.annotation:annotation:1.1.0'
    implementation 'androidx.lifecycle:lifecycle-extensions:2.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'com.squareup.retrofit2:retrofit:2.7.0'

    implementation 'com.github.mukeshsolanki:country-picker-android:2.0.2'
    allprojects {
        repositories {
            jcenter()
            maven { url "https://jitpack.io" }
        }
    }
}

minSDK is set to 21. This is the error build throws, i want my to use retrofit with androidx and minSDK 21, can some body help with this.

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

Attique Ur Rehman
  • 336
  • 1
  • 2
  • 19
  • Did you check this StackOverflow [thread](https://stackoverflow.com/q/49891730/5180017)? I hope it should solve your problem. If not, please [edit] the question and post full code from `build.gradle` (app level) file and JDK version installed in your system etc. – Shashanth Dec 19 '19 at 04:34
  • 1
    Thanks @Shashanth, adding following to app level build.gradle fixed the issue. ```compileOptions { sourceCompatibility 1.8 targetCompatibility 1.8 }``` – Attique Ur Rehman Dec 21 '19 at 17:35

0 Answers0