Android: ClassNotFoundException时,包括SimpleXML转换器Retrofit2



我使用Retrofit2来调用不同的API,到目前为止我只调用了REST API,但现在我需要一个SOAP API调用。在我向

添加依赖项之前,它一直正常工作。
compile 'compile('com.squareup.retrofit2:converter-simplexml:2.0.2') {
    compile.exclude module: 'stax'
    compile.exclude module: 'stax-api'
    compile.exclude module: 'xpp3'
}

让我有点抓狂。当调用时,我得到以下错误,我使用回调响应,并在失败子句中得到这个:

java.lang.ClassNotFoundException: Didn't find class
"user_font_size_normal" on path: DexPathList[[zip file "/data
/app/com.my.app.debug-2.apk", zip file "/data/data/com.my.app.debug
/code_cache/secondary-dexes/com.my.app.debug-
2.apk.classes2.zip"],nativeLibraryDirectories=[/data/app-lib
/com.my.app.debug-2, /system/lib]]

我启用了multiDex。如果我删除编译。排除我认为有一些ProGuard的问题,因为它不会编译。我使用gsonconverter从以前和使用改造2.0.2。

任何想法?最好的问候,克里斯托弗。

我不知道你是否仍然有这个问题,但我只是遇到了它,我只是不得不改变我的gradle依赖,看起来像这样。

compile('com.squareup.retrofit2:converter-simplexml:2.1.0', {
    exclude group: 'xpp3', module: 'xpp3'
    exclude group: 'stax', module: 'stax-api'
    exclude group: 'stax', module: 'stax'
})

希望对你有帮助。

最新更新