我想使用库来计算标准偏差,而不是编写我自己的方法,但是我没有能够消除这个错误:
FATAL EXCEPTION: main
Process: io.github.hactarce.qtimer, PID: 25294
java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/commons/discovery/tools/DiscoverClass;
    at org.apache.commons.math.stat.DescriptiveStatistics.newInstance(DescriptiveStatistics.java:91)
    at ...
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
 Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.commons.discovery.tools.DiscoverClass" on path: DexPathList[[dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-support-annotations-24.0.0_9d3ba58e638ed02faa84bf39a48fe2d24bde6b2a-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-slice_9-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-slice_8-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-slice_7-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-slice_6-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-slice_5-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-slice_4-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-slice_3-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-slice_2-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-slice_1-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-slice_0-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-me.zhanghai.android.materialprogressbar-library-1.1.6_3f4dfaff6ac84c0f0b41e456c4c7ea77b367a4b0-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-internal_impl-24.0.0_92a109cb571bd624e4bea6328895341c772d7c6c-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-commons-math-20040218.045431_cdd6a0543f856d0d318fbe7a891815a73a580ce9-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-com.android.support-support-vector-drawable-24.0.0_2a3a8f3ca104420ae4ace8cc58b02d413c7612ea-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-com.android.support-support-v4-24.0.0_bffc8401f241a00ed2f701ca43e6dffa2f80398d-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-com.android.support-recyclerview-v7-24.0.0_2c37df8ad6003e99ec2537a49be829f52468f887-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-com.android.support-appcompat-v7-24.0.0_73746d492da138f16fa685b4e64eeb56d351948f-classes.dex", dex file "/data/data/io.github.hactarce.qtimer/files/instant-run/dex/slice-com.android.support-animated-v我的分级档案:
apply plugin: 'com.android.application'
android {
    compileSdkVersion 'Google Apis:Google Apis:23'
    buildToolsVersion "23.0.1"
    defaultConfig {
        applicationId "io.github.hactarce.qtimer"
        minSdkVersion 18
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:23.0.1'
    compile 'com.afollestad.material-dialogs:core:0.8.6.0'
    compile 'com.afollestad.material-dialogs:commons:0.8.6.0'
    compile 'commons-math:commons-math:20040218.045431'
}关于类似的错误,我见过许多其他的答案,但似乎都没有帮助。提前谢谢。:)
发布于 2016-11-12 15:55:56
您绝对不应该使用构建文件中引用的jar。这不是正式发布的版本。这是一个未发布的快照构建,预约会版本1.0的共用数学.正如注释中所建议的,您应该升级到发布的版本,最好是3.6.1。
https://stackoverflow.com/questions/38649627
复制相似问题