Android - Bytecode to Dex conversion error with min sdk version

I try to start the application and continue to encounter an error:

Error:Error converting bytecode to dex:
Cause: default or static interface method used without --min-sdk-version >= 24

I'm not sure what is wrong, as it does not provide much information. It used to be. I considered similar questions, but they are different. They were all related to dependencies in build.gradle, although I showed it below.

compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version"
compile 'com.android.support:appcompat-v7:25.3.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:support-v4:25.3.1'

compile group: 'com.google.code.gson', name: 'gson', version: '2.8.0'
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile group: 'com.googlecode.libphonenumber', name: 'libphonenumber', version: '8.4.3'
compile group: 'com.pubnub', name: 'pubnub-gson', version: '4.6.2'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.7.3'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.7.3'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.7.3'
compile group: 'com.google.guava', name: 'guava', version: '21.0'
compile group: 'joda-time', name: 'joda-time', version: '2.9.7'
compile 'com.google.android.gms:play-services-maps:10.2.6'
compile 'com.google.android.gms:play-services-location:10.2.6'
+4
source share
1 answer

The culprit here is guava

compile group: 'com.google.guava', name: 'guava', version: '21.0'

change it to:

compile group: 'com.google.guava', name: 'guava', version: '22.0'

and he will work

you can see in the changelog: https://github.com/google/guava/wiki/Release21

+5
source

Source: https://habr.com/ru/post/1678208/


All Articles