Android - 使用min sdk版本将Bytecode转换为Dex时出错

时间:2017-05-31 01:00:41

标签: java android kotlin dex

我正在尝试运行我的应用并遇到错误:

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

我不确定出了什么问题,因为它没有提供太多信息。它以前运行过。我看过类似的问题,但他们是不同的。它们都与build.gradle中的依赖项有关,但我已经在下面显示了它。

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'

1 个答案:

答案 0 :(得分:5)

这里的罪魁祸首是番石榴

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

将其更改为:

{{1}}

它会起作用

你可以在更改日志中看到: https://github.com/google/guava/wiki/Release21