【问题标题】:Android - Error Converting Bytecode to Dex with min sdk versionAndroid - 使用 min sdk 版本将字节码转换为 Dex 时出错
【发布时间】:2017-05-31 01:00:41
【问题描述】:

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

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'

【问题讨论】:

    标签: java android kotlin dex


    【解决方案1】:

    这里的罪魁祸首是番石榴

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

    改成:

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

    它会起作用的

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

    【讨论】:

    • 从 22.0 更改为 21.0 帮助了我
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-10-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多